[18764] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 932 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri May 18 18:06:29 2001

Date: Fri, 18 May 2001 15:05:15 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <990223514-v10-i932@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 18 May 2001     Volume: 10 Number: 932

Today's topics:
    Re: Adding lines to the beginning of a data file? <joe+usenet@sunstarsys.com>
    Re: An Example Of A Polite FAQ nobull@mail.com
    Re: An Example Of A Polite FAQ <godzilla@stomp.stomp.tokyo>
    Re: An Example Of A Polite FAQ <mischief@velma.motion.net>
    Re: aol proxy (Abigail)
        Can anyone help me please? <Ask@For-It.Com>
    Re: Can anyone help me please? <AgitatorsBand@yahoo.com>
    Re: Can anyone help me please? <andras@mortgagestats.com>
    Re: Can anyone help me please? <Ask@For-It.Com>
    Re: Can anyone help me please? <Ask@For-It.Com>
    Re: Can anyone help me please? (Craig Berry)
    Re: Can anyone help me please? <Ask@For-It.Com>
    Re: cookie implementation nobull@mail.com
    Re: Excluding certain output variables? <davsoming@lineone.net>
    Re: File Test Operator Problem <clintp@geeksalad.org>
    Re: File Test Operator Problem (Eric Bohlman)
    Re: Filehandling, opening & Reopnening (Abigail)
    Re: garbage collection in perl <ilya@math.ohio-state.edu>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 18 May 2001 16:45:21 -0400
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: Adding lines to the beginning of a data file?
Message-Id: <m38zjuwfmm.fsf@mumonkan.sunstarsys.com>

Per Kistler <kistler@gmx.net> writes:

> Nick wrote:
> > open(USERLOG, ">>log.dat");
> >  seek(USERLOG,0,0);
> >  print USERLOG "New line of information.\n";
> > close(USERLOG);
> 
> If you open the file with sysopen and use syswrite after
> the seek stuff, it should work. 

I doubt it.

> I've just tested it a short while ago. 
> ( sysopen($file,O_RDWR | O_CREAT) etc. )

Please post your test code, noting that OP asked for a way of 
*inserting* new data, not overwriting old data.  Presumably you 
saw the FAQ answer and disagree with its recommendation?

  % perldoc -q insert

-- 
Joe Schaefer     "The eternal mystery of the world is its comprehensibility."
                                               --Albert Einstein


------------------------------

Date: 18 May 2001 19:24:22 +0100
From: nobull@mail.com
Subject: Re: An Example Of A Polite FAQ
Message-Id: <u97kzeo6qx.fsf@wcl-l.bham.ac.uk>

"Godzilla!" <godzilla@stomp.stomp.tokyo> writes:

> Subject: An Example Of A Polite FAQ

Basically I agree with everything you say here.

My main criticism is that it is way too long.  It needs a serious bit
of blue-pencil work to being it down to a resonable length. 

I find the chatty (even patronising) style and the preponderance of
exclamation marks grates on me, but maybe that's just me.

I also find it more than a little amuzing that, following recent
discussions, you have written this from the standpoint of someone who
assumes that they have implicit authority.  You do this _far_ more so
than Tad's version ever did.  Where Tad would say "You must do FOO"
you say "Do FOO".  That changes the slant from "I believe you have an
obligation to do FOO" to "I use my authority to order you to do FOO".

Personally I don't find the fact that a document like this is written
from a stance of assumed authority to be offensive.  But I were to
find it offensive then I would definitely find the Godzilla document
more offensive than the Tad one.  Even so I doubt I would resort to
"jack boot" metaphors.

Now for some more detailed constructive criticism of some parts.  The
rest was IMNSHO basically right.

> Welcome to comp.lang.perl.misc newsgroup!

Loose the "!".  I won't mention this again but you should loose
vitually all the "!" throughout this document.

> This newsgroup, commonly called clpm, is a technical newsgroup
> intended to be used for discussion of any and all Perl related
> issues, whether it be comments or questions. This is an unmoderated
> newsgroup and all are invited to drop in and visit, even if just
> to say hello!

Loose the last sentence - some people will find it patronising and it
doesn't really add anything.  Remeber not all readers read English as
a first language it is not kind to make them wade through waffle.  Try
to maintain a good signal-to-noise ratio.  Hereinafter I'll just say
"noise".

> As a technical newsgroup, clpm is a bit different than most
> general topic newsgroups. As you would expect, clpm discussions
> are usually very technical in nature and there are some guidelines
> for usage of this newsgroup which are somewhat different than
> the average. This document provides information to assist you
> in both obtaining the best usage of clpm and to help you have fun! 

Would I be right to I assume "different than" is considered OK in US
English?  In English English it's considerd affected.  Also "which"
should be "that".  As you delight in pointing I'm fairly sloppy in my
grammar where it doesn't matter, but in a document like this poor
grammar is very off-putting.

I'm not disagreeing with the sentiments expressed above but we need to
keep this concise:

"As you would expect, clpm discussions are usually very technical in
nature and there are conventions for conduct in technical newsgroups
going somewhat beyond those in non-technical newsgroups."
 
>  1a. Check the Perl Frequently Asked Questions (FAQ)
> 
>    A wonderful resource is avaiable for you. This resource
>    is a very comprehensive time tested collection of questions
>    most often asked. It is a resource written by long time
>    Perl professionals and provides quick easy to understand
>    answers to almost all questions you may have! You will
>    find answers here quicker than in clpm. Have a look!

First and last sentences are noise.

>  1b. Check the other standard Perl docs (*.pod)
> 
>    Should you have Perl installed on your home machine or
>    have access to a Perl installation on your internet service
>    provider, you have an extremely extensive resource data base
>    right at your fingertips! Perl contains just about every bit
>    of information you could ever want to know about Perl, right
>    there behind your keyboard. Read your documentation for your
>    Perl installation at home, or ask your server how to access
>    these features. It is very simple! This is an extremely valuable
>    resource. There are great search features, lots of explanations,
>    all waiting there for you Don't overlook this!

Too long.  

"Should you have access to a Perl installation, you have an extremely
extensive resource data base right at your fingertips. Perl contains
just about every bit of information you could ever want to know about
Perl, right there behind your keyboard. Read your documentation at
home, or ask your service provider how to access it.  There are great
search features, lots of explanations so don't overlook this."

>    If you experience difficulties in making use of this feature,
>    please feel free to visit clpm and ask how to do this! Lots
>    of folks will assist you, very quickly.

Noise.

>  1c. Lurk for a while before posting
> 
>    This is very important and is expected regardless of what newsgroup
>    you are visiting. Lurking means to simply monitor a newsgroup for
>    a period of time until you become very familiar with local customs.
>    Think of a newsgroup as foreign culture. Each newsgroup has its own
>    specific customs and rituals. Get to know those customs and rituals
>    well before you participate. This will help you to avoid embarrassing
>    social situations. Consider yourself to be a foreigner at first!
>    Mind your manners lest we toss you in pot and cook you for dinner!

A bit long but probably worth keeping verbatim.  In this case I'd even
keep the final exclamation mark!

>  1d. Search a Usenet archive or discussion group
> 
>    There are tens of thousands of Perl programmers. It is very likely
>    your question has already been asked and answered many times! See
>    if you can find where it has already been answered. If you are making
>    a comment rather than asking a question, search the archives first!
>    You will discover many interesting coversations about many topics
>    related to Perl. Do your homework and make a great impression!

s/rather than/or/;

>  1e. Check Other Resources
> 
>   You may want to check in books or at web sites to see if you can
>   find an answer to your question or become more knowledgable about
>   a specific Perl related topic for general discussion.
> 
>       (short list of Perl sites and Perl book list sites)

A valid sentiment but probaly not worth mentioning in this document.
 
> 2. Posting to comp.lang.perl.misc
> _________________________________
> 
> 
>  2a. Is there a better place to ask your question?
> 
>    Questions should be related to Perl programming as this is the
>    intent of the clpm newsgroup.

Noise.
 
>    It can be challenging to ascertain what is your actual programming
>    problem. It might be Perl related or something which appears to be
>    Perl related but is not. Make a conscious effort to determine if your
>    concern is actually Perl related. There are many technical newsgroup
>    covering just about everything concerning computers and programming.
>    If you suspect your problem is Perl related, drop in and ask! If you
>    have a hunch it is something else, perhaps an operating system problem
>    or perhaps a server problem, work at locating a newsgroup related to
>    those topics. You will attain faster and better answers in newsgroup
>    directly related to your topic. If you are completely unsure, visit
>    this newsgroup and ask for assistance. Many will direct you to better
>    resources, to better newsgroups.

Basically OK, probably could be tightened a little.

>    Sometimes we need help simply finding a problem. There are many methods
>    for narrowing a problem area in a program. Do a little research and you
>    will find lots of good advice on pinpointing a problem. Feel free to
>    drop in and ask about ways to narrow down a problem. We will help.

This is good but probably redundant in the light of subsequent
sections.

> 
>  2b.  Carefully choose the contents of your Subject header
> 
>    Choosing a good Subject Line Topic is truly an art. Give careful consideration
>    to your topic line. [...]

Consistant nomenclature would be good.  Let's call it "Subject header"
throughout not "Subject Line Topic" or "topic line".

>             [...] Work at keeping it as short as possible yet describe your
>    topic clearly and concisely. There is no need for complete sentences nor even
>    perfect grammar. Keep it short, sweet and descriptive. [...]

Now, as regular readers will know, I have particualrly strong feelings
about this.  I would add:

"To determine if your subject header is good enough ask yourself, 'Had
I seen this in the search I've just done would I have recognised it as
the same topic?'  If you haven't just done a search then go back to
1d!"

>                                              [...] Do avoid using
>    expressions like, "Help! I am a newbie!" or "URGENT! I need
>    help!". This is a guarantee your article will never be read and
>    possibly, you may find yourself in trouble!

OK, even by my relaxed standards this last sentence is too much a
statement of implied authority:

"Phrases like these will lead many people to ignore your article and
will bias others against you."

>    As an example, if your program won't open a file to read, use a topic like,
> 
>      "File open failure" rather than "It won't work!"

A better example:

  As an example, if your program won't open a file of football scores, use a topic like,

     "File open failure" rather than "It won't work!" or "Football program".

>  2d. Speak Perl Programming language when possible
> 
>    Perl is inherently a technical programming language. Try to speak
>    in Perl as best you can! This, everyone will understand. Write out
>    your problem using Perl code as much as possible. Very often, a little
>    code goes a long ways in finding a problem. Add explanations as needed
>    but try to keep Perl code and explanations sorted out, separated.
> 
>    Avoid this: I have variable with "foo\tbar" in it.
> 
>    Use this: I have $var = "foo\tbar".
> 
>    You see! Now everyone knows your variable name and can watch
>    for problems associated with that variable name.

No specific criticism, probably could do with being a bit tighter.
  
>  2c. Do your machine homework first

I think "Get Perl to help you" would better.

>    You can ask perl itself to help you find common programming mistakes!
>    Perl has numerous built-in functions which will warn you about possible
>    mistakes, even tell you what is your mistake! Use these features!
> 
>    These are a few examples of how Perl can help you.

Noisy, noisy! Of the 4 sentences above only the 2nd is signal.

>    enable warnings (perldoc warnings)
>    enable strictures (perldoc strict)
>    use diagnostics
> 
>    Your Perl resources, such as books, internet sites, your own Perl
>    installation can help you learn how to use these helpful functions
>    and many more.

Signal.

>                   They are great! They will tell you what is wrong and
>    won't even call you dummy! If you need help in this area, drop right
>    on into clpm and ask! Lots of good advice can be had for the asking.

Noise.
 
>  2e. Provide just the right amount of information

[snip]
 
>    Carefully describe input to your program. Make sure it is very
>    clear and concise; set good parameters. Also provide example
>    input data for your program. If you need to show file input,
>    use the __DATA__ token (perldata.pod) to provide disk drive
>    file contents for your Perl program. An alternative is to
>    simple include,
> 
>       This is my input data: "Insert your data precisely!"

I think you need to re-think the phrase 'to provide disk drive file
contents for your Perl program'.

And finally...

>                             ...your best weapon is to ignore a
>    person who is causing trouble...

Comming, as it does, from Godzilla doesn't this statement create a
"Liar Paradox"?   http://www.utm.edu/research/iep/p/par-liar.htm

Anyhow, contratulations on a basically sound document.  Do _not_
adjust your medication - you seem to have it about right now.  BTW, how
is Frank? :-)

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


------------------------------

Date: Fri, 18 May 2001 12:08:41 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: An Example Of A Polite FAQ
Message-Id: <3B057339.B433081A@stomp.stomp.tokyo>

nobull@mail.com wrote:
 
> Godzilla! wrote:
 
> > Subject: An Example Of A Polite FAQ
 
> Basically I agree with everything you say here.

(snipped)
 
Please direct your comments to McCellan. He is writing
this FAQ document. I am not.

Godzilla!


------------------------------

Date: Fri, 18 May 2001 20:20:04 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: An Example Of A Polite FAQ
Message-Id: <tgb0vkr8dpl6a0@corp.supernews.com>

Jenda Krynicky <Jenda@krynicky.cz> wrote:
> On Thu, 17 May 2001 07:25:20 -0700, "Godzilla!" <godzilla@stomp.stomp.tokyo> wrote:

[snip]
 
>> "You are a mature responsible person...."

[snip]

>> Diplomacy is of utmost importance and, proves the
>> hardest talent of all to master.

> Oh sh*t, political correctness rears its ugly head ...

[next line hand-wrapped at a length easier to follow]

> I seriously doubt any youngster would be offended if you called
> him/her "adult".
> Unless seriously brainwashed.

"Never trust anyone over thirty" you mean? I think the biggest
mistakes in calling a teenager an adult are the possible ego trip
and the possible alienation. Some at those ages are too eager
to claim adulthood and its perceived freedom from restraint.
Others will recoil, realizing that the adults around them rarely
seem to understand what a teenager experiences. The former is
bad if we want them to be well-behaved members of the group, and
the latter is bad if we hope for them to feel comfortable in the
group. Better to just say "mature responsible person" as Kira
suggests.

Chris
-- 
Even in the worst of times, there is always someone who's
never had it better. Even in the best of times, there is
always someone who's never had it worse.



------------------------------

Date: Fri, 18 May 2001 21:01:29 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: aol proxy
Message-Id: <slrn9gb3d9.87b.abigail@tsathoggua.rlyeh.net>

Joe Schaefer (joe+usenet@sunstarsys.com) wrote on MMDCCCXVI September
MCMXCIII in <URL:news:m3n18cztph.fsf@mumonkan.sunstarsys.com>:
\\  "Patrick Joyce" <joycefive@earthlink.net> writes:
\\  
\\ > i have a problem. what is up with aols proxy servers i have written a perl
\\ > script that needs a uniqe host name. but with aol proxy the hostnames chang
\\ > often, how do i fix this and or why is this
\\  
\\  Although TCP is part of the HTTP protocol, IP isn't. Proxy servers are 

What a strange statement. The TCP/IP model uses five layers, in which
protocols like HTTP are in layer 5, TCP in layer 4 and IP in layer 3.

I wouldn't call TCP part of the HTTP protocol, but I could see someone
does. However, I utterly fail to understand the reasoning that includes
TCP as part of the HTTP protocol, but excludes IP.

\\                                                       Proxy servers are 
\\  under no obligation to pass along IP addresses.

Proxies work on the application level. Even if the HTTP protocol had a
way to pass IP addresses, they would be useless. LANs using IP addresses
from the private regions are very common - and the IP addresses used
there are far from unique.


Abigail
-- 
perl -swleprint -- -_='Just another Perl Hacker'


------------------------------

Date: Fri, 18 May 2001 22:16:45 +0100
From: "Robb Meade" <Ask@For-It.Com>
Subject: Can anyone help me please?
Message-Id: <9e43cg$cg4$1@newsg2.svr.pol.co.uk>

Hi all,

I'm having real problems with my mailing list script here, I just dont know
whats causing the problem...

I've also noticed now that sometimes the ?site=mysitename doesnt seem to get
used properly by the script, as it doesnt return the value...

Can anyone offer some help please?

--

Robb Meade

Kingswood Web Services
www.kingswoodweb.net






------------------------------

Date: Fri, 18 May 2001 21:24:51 GMT
From: Scratchie <AgitatorsBand@yahoo.com>
Subject: Re: Can anyone help me please?
Message-Id: <DqgN6.1064$du2.100389@news.shore.net>

Robb Meade <Ask@for-it.com> wrote:
: I've also noticed now that sometimes the ?site=mysitename doesnt seem to get
: used properly by the script, as it doesnt return the value...

: Can anyone offer some help please?

You gotta give us a little more to work with here.

What is the script supposed to be doing with the site= value?

What is the code that is supposed to be doing it?

--Art


------------------------------

Date: Fri, 18 May 2001 17:23:18 -0400
From: Andras Malatinszky <andras@mortgagestats.com>
Subject: Re: Can anyone help me please?
Message-Id: <3B0592C6.2BE4DAD3@mortgagestats.com>



Robb Meade wrote:
> 
> Hi all,
> 
> I'm having real problems with my mailing list script here, I just dont know
> whats causing the problem...
> 
> I've also noticed now that sometimes the ?site=mysitename doesnt seem to get
> used properly by the script, as it doesnt return the value...
> 
> Can anyone offer some help please?
> 

Probably not unless you post some code an explain what exactly your
problem is.


------------------------------

Date: Fri, 18 May 2001 22:30:10 +0100
From: "Robb Meade" <Ask@For-It.Com>
Subject: Re: Can anyone help me please?
Message-Id: <9e445l$d30$1@newsg2.svr.pol.co.uk>

Hi!

Thanks for replying - most of the info you need is in my other postings
title 'the perl version of this would be' and 'only one line of code
returning from form?'...

Basically, this is what I need to do..

Pass via a query string several values, one of which is a url (kinda), ie,
site = www.boomshankers.com this is used by my ASP pages to tell which
client is logged in etc..

the actual script is a mailing script which emails every subscribed user...

The problems I'm having are :

anything after the first line of text enter on the form is not displayed in
the email? altough it is being passed to the script
and
sometimes, but not always, the ?site= value doesnt seem to be added to the
url in my redirect, and therefore causes my ASP page to fail..

If you want the code posted again, let me know..


--

Robb Meade

Kingswood Web Services
www.kingswoodweb.net


"Scratchie" <AgitatorsBand@yahoo.com> wrote in message
news:DqgN6.1064$du2.100389@news.shore.net...
> Robb Meade <Ask@for-it.com> wrote:
> : I've also noticed now that sometimes the ?site=mysitename doesnt seem to
get
> : used properly by the script, as it doesnt return the value...
>
> : Can anyone offer some help please?
>
> You gotta give us a little more to work with here.
>
> What is the script supposed to be doing with the site= value?
>
> What is the code that is supposed to be doing it?
>
> --Art




------------------------------

Date: Fri, 18 May 2001 22:34:59 +0100
From: "Robb Meade" <Ask@For-It.Com>
Subject: Re: Can anyone help me please?
Message-Id: <9e44em$sju$1@newsg1.svr.pol.co.uk>

Ok - i've posted the problem (several times now :(  ) - and here's the
code...

***************************** BEGINS **************************************

#!/usr/bin/perl -w
use strict;
use CGI qw(:all);
use CGI::Carp qw(fatalsToBrowser);
my $site=param("site");
my
$target="http://www.kingswoodweb.net/clientmailingconfirm.asp?site=$site";

####################################
# new sub to retrieve mailing list #
####################################
sub send_to($)
{
my $file = shift;
my @list;
open(SEND, "< $file") or die "Could not open $file: $!";
@list = <SEND>;
close SEND;
return(@list);
}

sub send_mail {


  my $sendmail="/usr/sbin/sendmail -t -oi";

  my $from="mailing.list\@boomshankers.com";

my $subject=param("subject");
my $message=param("message");


############################################################
# return value of send_to sub is placed into your new list #
############################################################

my @email_list = send_to("email.txt");

##################################
# loop through each item in list #
##################################

for my $to (@email_list)
{
chomp $to;

open(MAIL, "|$sendmail") || die "Can't start sendmail: $!";
  print MAIL<<END_OF_HEADER;
From: $from
To: $to
Subject: $subject

$message

END_OF_HEADER

  close(MAIL);
} # for loop complete
}

send_mail();

print redirect( -url => $target );

******************************* ENDS *************************************

Quite often the $site value isnt sent from the script, and this causes my
ASP page to then fail, which uses this value to pull information from a
database.
The $message only displays one line of text entered in the form, although
all text is being sent to the script?  (line breaks??)

Any help *really* appreciated...

--

Robb Meade

Kingswood Web Services
www.kingswoodweb.net


"Robb Meade" <Ask@For-It.Com> wrote in message
news:9e43cg$cg4$1@newsg2.svr.pol.co.uk...
> Hi all,
>
> I'm having real problems with my mailing list script here, I just dont
know
> whats causing the problem...
>
> I've also noticed now that sometimes the ?site=mysitename doesnt seem to
get
> used properly by the script, as it doesnt return the value...
>
> Can anyone offer some help please?
>
> --
>
> Robb Meade
>
> Kingswood Web Services
> www.kingswoodweb.net
>
>
>
>




------------------------------

Date: Fri, 18 May 2001 21:37:30 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Can anyone help me please?
Message-Id: <tgb5gqio906bf1@corp.supernews.com>

Robb Meade (Ask@For-It.Com) wrote:
: I'm having real problems with my mailing list script here, I just dont
: know whats causing the problem...

  use PSI::ESP;
  my $psychic_friend = new PSI::ESP('Robb Meade');
  $psychic_friend->diagnosePerlBug() or die "Can't diagnose remotely: $!";

Unfortunately, this attempt dies with a "Etheric vibrations muddled"
error message...are you sure you've adjusted the Ouija board on your end
properly?

Meanwhile, we'll have to fall back on boring old text.  Post the (small
fragment of) code which is causing you problems, describe what you think
it should do and what it is actually doing, and we'll do our best to help
you out.

: I've also noticed now that sometimes the ?site=mysitename doesnt seem to get
: used properly by the script, as it doesnt return the value...

Again, let's see some code.  It's best to isolate the problem, especially
by recasting it as a very brief example.  Nobody will look at your code if
you post a thousand-line application.

-- 
   |   Craig Berry - http://www.cinenet.net/~cberry/
 --*--  "God becomes as we are that we may be as he is."
   |               - William Blake


------------------------------

Date: Fri, 18 May 2001 22:48:55 +0100
From: "Robb Meade" <Ask@For-It.Com>
Subject: Re: Can anyone help me please?
Message-Id: <9e458q$dve$1@newsg2.svr.pol.co.uk>

"Craig Berry" wrote ...

> Again, let's see some code.  It's best to isolate the problem, especially
> by recasting it as a very brief example.  Nobody will look at your code if
> you post a thousand-line application.

I've posted the code now several times - I guess your news servers havent
caught up with it yet.... :(

I cannot 'isolate' the problem very well, as I do not have a good knowledge
of Perl, or indeed any to be honest...I always found it quite hard to work
out because of the various sets of / and \ and letters and so on, kinda why
I moved to ASP...that aside - for this project - and indeed some future ones
I'm going to have to learn more of it..as my web host uses Linux and I need
to use Sendmail as I have no CDONTS access..

My only understanding of the problem in hand is that its supposed to be
sending the message typed into a form (textarea) on one page, via a
querystring, to the perlscript, when I use the ASP Response.Write to show
the querystring, it has all of what was typed...when its processed by my
Perl script, the first line of the message type in gets sent in the email,
and thats all....

I 'assume' its something to do with the detection of the carriage return,
but I dont know, I have no experience really with Perl, hence asking, no,
begging for help with it...

I really wish I had more time to sit back and learn this, but for me, ASP
has come more naturally, probably from having a 'basic' background etc...

Anyway...I hope the code I've posted appears soon...

Regards



--

Robb Meade

Kingswood Web Services
www.kingswoodweb.net





------------------------------

Date: 18 May 2001 19:49:55 +0100
From: nobull@mail.com
Subject: Re: cookie implementation
Message-Id: <u9r8xmmqzw.fsf@wcl-l.bham.ac.uk>

"Serg Vasilev" <serg@pbox.ttn.ru> writes:

> "Troy Boy" <troyr@vicnet.net.au> wrote in message
> news:H8_M6.82$Ld4.2097@ozemail.com.au...
> [skip]
> >     $the_cookie = cookie(-name=>'sid',
> >                          -value=>$session_id,
> >                          -expires=>'+1m',
> >                          -domain=>'.vicnet.net.au',
> >                          -path=>'/');
> 
> 
> How do you generate $session_id?

Lots of posibilities.  For a single-homed server File::CounterFile
would suffice.  For a multi-homed Apache server you'd use
mod_unique_id.  Similar features probably exist in other HTTP server
software but that's off-topic here.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


------------------------------

Date: Fri, 18 May 2001 21:14:15 +0100
From: "David Soming" <davsoming@lineone.net>
Subject: Re: Excluding certain output variables?
Message-Id: <tgb2pvl2rn68ba@corp.supernews.co.uk>

Thank for your input Tad.
Yes I originally did not specify the exclusion- sorry thought I had :)
I have also installed perl for windows to test and view warning/errors
thanks for the appreciated advice.

David




------------------------------

Date: Fri, 18 May 2001 18:51:50 GMT
From: Clinton A. Pierce <clintp@geeksalad.org>
Subject: Re: File Test Operator Problem
Message-Id: <bmragt0lrfnfddmld9f3s219pk6e44jgfh@4ax.com>

On Fri, 18 May 2001 19:04:31 +0100, Helge Steen <steen@biochip.com>
wrote:

>Hi all,
>
>I am experiencing a strange problem with the -f file test operator on a
>IRIX 6.5 machine.
>
>I am trying to identify regular files in a directory listing, generated
>using
>
>@ALLFILES = readdir DIRHANDLE;
>
>The listing is fine when logged in as root as well as when logged in as
>a user.  In both cases I can nicely read and write files in the listed
>directory, but  (-f filename) will never become true when logged in as a
>user. When logged in as root, -f is OK. Sounds like an access problem,
>but I can not imagine where things go wrong...

There's no code in your post so it's kind of hard for us to imagine as
well.  

Consider that -f, -d and friends will set $! if they fail.  The error
message in there might be helpful.  Also if you're not using absolute
pathnames, being root and being a mortal user might have the program
running in different directories.


-- 
  Clinton A. Pierce              Teach Yourself Perl in 24 Hours *and*
  clintp@geeksalad.org         Perl Developer's Dictionary -- May 2001
"If you rush a Miracle Man,     for details, see http://geeksalad.org
        you get rotten Miracles." --Miracle Max, The Princess Bride


------------------------------

Date: 18 May 2001 18:56:09 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: File Test Operator Problem
Message-Id: <9e3r89$o1p$1@bob.news.rcn.net>

Helge Steen <steen@biochip.com> wrote:
> Hi all,

> I am experiencing a strange problem with the -f file test operator on a
> IRIX 6.5 machine.

> I am trying to identify regular files in a directory listing, generated
> using

> @ALLFILES = readdir DIRHANDLE;

> The listing is fine when logged in as root as well as when logged in as
> a user.  In both cases I can nicely read and write files in the listed
> directory, but  (-f filename) will never become true when logged in as a
> user. When logged in as root, -f is OK. Sounds like an access problem,
> but I can not imagine where things go wrong...

Are you sure you aren't forgetting that readdir() gives you only the 
basenames of your files, not their full paths, whereas -f wants a full 
path if the file isn't in your CWD?



------------------------------

Date: Fri, 18 May 2001 21:21:17 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: Filehandling, opening & Reopnening
Message-Id: <slrn9gb4id.87b.abigail@tsathoggua.rlyeh.net>

Mika Morell (mika.morell@se.abb.com) wrote on MMDCCCXVI September
MCMXCIII in <URL:news:3B03E1DC.94427749@no-spam-what-so-ever.se.abb.com>:
[]  Hi.
[]  
[]  This is kind of anewbie question, first time for perl. I need to reread
[]  the same file 18 times, is there a way to not having to open and close
[]  it 18 times.  With this layout of the script it only reads the file
[]  once. And if I move the opening/closing of LOGFILE inside the for loop
[]  it takes forever. The important part of the script looks like this:
[]  
[]  open (LOGFILE,"$tmplog") || die "YOu killed kenny!!! YOu Bastard\n";
[]  for ($i = 1 ; $i <=$total; $i++) {
[]      open (OUTFILE,">>$outpath/$hosts[$nuffra].log.txt");
[]      while (<LOGFILE>){
[]                    if (/\ $hosts[$nuffra]\ /) {
[]         print OUTFILE ("$_");
[]        }
[]                       }
[]  close OUTFILE|| die " Someone is bakin brownies\n";
[]  $nuffra++;
[]  }


Well, the short answer to your question is, you can use seek.

The long answer is, you asked the wrong question. You don't want to
avoid opening the file 18 times, you want to avoid reading the file
18 times.

The right way to do it is to open all the $hosts[$nuffra].log.txt 
files for append, open $tmplog for read, and then for each line 
determine which file it has to be appended to. Determining which
file that is is very likely to be done far more efficient than
running up to 18 regexes - but how to do it depends on the format
of the logs. You'd like to extract the host from the line, and
then - having the filehandles in a hash indexed by host name -
select the right filehandle and print to it.

And don't use 'print "$_"'. No need to stringify $_.



Abigail


-- 
srand 123456;$-=rand$_--=>@[[$-,$_]=@[[$_,$-]for(reverse+1..(@[=split
//=>"IGrACVGQ\x02GJCWVhP\x02PL\x02jNMP"));print+(map{$_^q^"^}@[),"\n"


------------------------------

Date: 18 May 2001 18:31:25 GMT
From: Ilya Zakharevich <ilya@math.ohio-state.edu>
Subject: Re: garbage collection in perl
Message-Id: <9e3ppt$j43$1@agate.berkeley.edu>

[A complimentary Cc of this posting was sent to
M.J.T. Guy
<mjtg@cus.cam.ac.uk>], who wrote in article <9e3h58$k86$1@pegasus.csx.cam.ac.uk>:
> >But b has a loophole: one can circumvent the runtime-effect, and leave
> >only the compile-time effect (creation of a "name") of my():
> >
> >  my $var if 0;

First of all, let me fix myself: I said that the runtime effect of
my($var) is the same as of undef($var).  Of course, this would beat
all the optimizations we discussed here!

The actual runtime effect is of $var = undef; this differs from
undef($var), since undef() releases the buffers associated with the
variable.

> But note that's a bug.

Says who?  Initially it was an oversight, but as things go today, it
became a feature.

>			   It might even get mended some day.
> (The only reason it hasn't been mended already is that nobody knows
> how to fix it without adding overhead in the much more common case
> 
>    my $var = 'some_initial_value';

Get real!  Given a want, it would be trivial to fix.  Remember that
SASSIGN has "arguments are inverted" flag?  You just duplicate all the
PADLEX (sp?) opcodes with INTRO flag present, put the copies after the
corresponding NEXTSTATE, and remove the INTRO flag of the originals.
This would be a pessimization indeed, since the above assignment
becomes

  NEXTSTATE PADLEX(INTRO) CONST PADLEX SSASSIGN

instead of

  NEXTSTATE CONST PADLEX(INTRO) SSASSIGN

But since one can remove the second PADLEX:

  NEXTSTATE PADLEX(INTRO) CONST SSASSIGN(INVERTED)

this is not a problem at all.

Ilya


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 932
**************************************


home help back first fref pref prev next nref lref last post