[11707] in Perl-Users-Digest
Perl-Users Digest, Issue: 5307 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 6 05:07:24 1999
Date: Tue, 6 Apr 99 02:00:20 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 6 Apr 1999 Volume: 8 Number: 5307
Today's topics:
Re: Active perl / Win98 and Apache <Savage.Ron.RS@bhp.com.au>
Re: array question (Dmitry Epstein)
Re: array question (Sam Holden)
Re: Backslash: unclear on the concept (Dmitry Epstein)
Re: Backslash: unclear on the concept (Ronald J Kimball)
Re: Backslash: unclear on the concept (Larry Rosler)
Re: Backslash: unclear on the concept (Tad McClellan)
Re: Cgi Communication with Layers? <bill@fccj.org>
CGI.pm - Doesn't recognize consecutive white spaces rajesh_bhave@my-dejanews.com
Conference paper deadline imminent <gnat@frii.com>
Re: Counting files with various extentions (Dmitry Epstein)
Re: Does anyone know how to do date/time functions in P smnayeem@my-dejanews.com
Re: Does anyone know how to do date/time functions in P (Bill Moseley)
Re: Does anyone know whats wrong with my script? (Tad McClellan)
flocking question - worried <c-denman@dircon.co.uk>
Re: here docs vs qq quote operator. Just personal prefe (Ronald J Kimball)
Re: here docs vs qq quote operator. Just personal prefe (Ronald J Kimball)
Re: here docs vs qq quote operator. Just personal prefe (Tad McClellan)
Re: here docs vs qq quote operator. Just personal prefe <jeromeo@atrieva.com>
Re: How do I simply delete a file in CGI? <jeromeo@atrieva.com>
How to check for benchmark speed of a program? agniora@usa.net
perl 509 and iis <arie@kba.org.il>
Re: Pick one of two files (Tad McClellan)
Re: Return value undef, but with || undef'ed value, res (Ronald J Kimball)
Re: Script to run ftp (brian d foy)
Re: Speed of PERL (Tad McClellan)
Re: Using Perl For ErrorDocuments (Tad McClellan)
Re: Very large regular expressions (Ronald J Kimball)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 6 Apr 1999 15:46:50 +1000
From: "Ron Savage" <Savage.Ron.RS@bhp.com.au>
Subject: Re: Active perl / Win98 and Apache
Message-Id: <7ec75d$16v17@atbhp.corpmel.bhp.com.au>
On my web site you'll find configureApache.pl.
--
Ron Savage
Office (preferred): Savage.Ron.RS@bhp.com.au
Home: rpsavage@ozemail.com.au
http://www.ozemail.com.au/~rpsavage
Ray McVay wrote in message <37044027.59BF66F8@acm.org>...
>David Smith wrote:
>>
>> I have the following installed
>>
>> ActivePerl 509
>> Win98
>> Apache 1.3.6
>>
>> It would seem that although the line :
>>
>> perl prog.pl
>>
>> will run the webserver does not want to run any scripts at all,
>
>Do you have a #!/perl_directory/bin/perl in it?
>Have you set the ScriptAlias correctly?
>That's about all there is to it.
>
>--
>
>Ray
>+--------------------------------------------------+
>+ I've gone to look for myself. If I should return +
>+ before I get back, keep me here!! - Bill the Cat +
>+--------------------------------------------------+
>
>
------------------------------
Date: Tue, 06 Apr 1999 04:53:44 GMT
From: mitiaNOSPAM@nwu.edu (Dmitry Epstein)
Subject: Re: array question
Message-Id: <370e912c.52975414@news.acns.nwu.edu>
On Tue, 23 Mar 1999 10:55:15 -0500, Ala Qumsieh <aqumsieh@matrox.com>
wrote:
>
>Mark P. wrote:
>> $file_extension =~ /\.(.*)$/is;
>
>1) The /i isn't needed.
>2) The /s isn't needed.
>3) Your match is greedy.
>4) You assign the extension to $1, but never use $1.
$file_extention = /\..*?$/; # (Assuming that $_ is the file name)
$file_extention = /\.[^\/]*?$/; # (Assuming that $_ may contain
# a path (e.g. /foo.ext/bar)
Dmitry
------------------------------
Date: 6 Apr 1999 05:37:27 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: array question
Message-Id: <slrn7gj7cn.qri.sholden@pgrad.cs.usyd.edu.au>
On Tue, 06 Apr 1999 04:53:44 GMT, Dmitry Epstein <mitiaNOSPAM@nwu.edu> wrote:
>On Tue, 23 Mar 1999 10:55:15 -0500, Ala Qumsieh <aqumsieh@matrox.com>
>wrote:
>>
>>Mark P. wrote:
>>> $file_extension =~ /\.(.*)$/is;
>>
>>1) The /i isn't needed.
>>2) The /s isn't needed.
>>3) Your match is greedy.
>>4) You assign the extension to $1, but never use $1.
>
>$file_extention = /\..*?$/; # (Assuming that $_ is the file name)
You sure you just want to set it to 1 if the file has a . in it?
If you meant to capture the result then maybe some ()s and a look in
$1 would be useful.
It's wrong anyway, in that it given the filename 'foo.bar.txt' it matches :
'.bar.txt'.
Non-greddy matching doesn't stop you getting the left most match...
>
>$file_extention = /\.[^\/]*?$/; # (Assuming that $_ may contain
> # a path (e.g. /foo.ext/bar)
Same problems as above...
Did you test this at all?
I'm sure I just missed the context for why it couldn't happen, but why is the
/s not needed....
I 've seen files with \n's in them... why I just created one then...
--
Sam
I would like to tell you that Perl is simple in its complexity. But some
people won't understand that. So pretend I didn't say that, unless you
do. --Larry Wall
Sam
------------------------------
Date: Tue, 06 Apr 1999 04:35:08 GMT
From: mitiaNOSPAM@nwu.edu (Dmitry Epstein)
Subject: Re: Backslash: unclear on the concept
Message-Id: <370d8eb9.52348331@news.acns.nwu.edu>
On Mon, 05 Apr 1999 22:06:03 GMT, mitiaNOSPAM@nwu.edu (Dmitry Epstein)
wrote:
>My question is: how exactly does backslash (\) work in string
>literals?
>
>I came upon this when I tried to assign something like this:
>
> \Qsomething\E
>
>to $foo, and later use $foo as a regular expression:
>
> /$foo/
<snip>
Thank you all for replies. Now I understand what happened. To what
has been said I would like to add that although I was well aware of
the special meanings of \Q and \E (that's why I was using them - to
quote any metacharacters in between), I thought they were only
interpolated in regexp operators like m// and s///. Boy, was I wrong!
- as the man section "perlop/Gory details of parsing quoted
constructs" makes clear (thank you, Ilya).
------------------------------
Date: Tue, 6 Apr 1999 01:25:25 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Backslash: unclear on the concept
Message-Id: <1dptb1k.1bjkko0rcj71wN@[207.60.170.55]>
Larry Rosler <lr@hpl.hp.com> wrote:
> Within double quotes, \Q (and lots of other \-letter combinations) has a
> special meaning. Most of them create a single character. But the
> following don't (from perlsyn):
s/perlsyn/perlop/;
Under Quote and Quote-like Operators.
--
_ / ' _ / - aka -
( /)//)//)(//)/( Ronald J Kimball rjk@linguist.dartmouth.edu
/ http://www.tiac.net/users/chipmunk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Mon, 5 Apr 1999 23:10:23 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Backslash: unclear on the concept
Message-Id: <MPG.1173452ad92c6781989844@nntp.hpl.hp.com>
In article <1dptb1k.1bjkko0rcj71wN@[207.60.170.55]> on Tue, 6 Apr 1999
01:25:25 -0400, Ronald J Kimball <rjk@linguist.dartmouth.edu >says...
> Larry Rosler <lr@hpl.hp.com> wrote:
>
> > Within double quotes, \Q (and lots of other \-letter combinations) has a
> > special meaning. Most of them create a single character. But the
> > following don't (from perlsyn):
>
> s/perlsyn/perlop/;
>
> Under Quote and Quote-like Operators.
How creative I am -- I invented a new type of off-by-one error! (Note
the order of the files listed in `perldoc perl`.)
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Mon, 5 Apr 1999 20:17:15 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Backslash: unclear on the concept
Message-Id: <bqjbe7.0pv.ln@magna.metronet.com>
Dmitry Epstein (mitiaNOSPAM@nwu.edu) wrote:
: This may seem like a trivial question, but sometimes even bright
: people like myself get stuck with something like this and need
: someone's help :) I looked in the documentation and the FAQ, but
: couldn't find the answer.
Hmmm.
I guess you tried the "Quote and Quote-like Operators"
section in perlop.pod?
: My question is: how exactly does backslash (\) work in string
: literals?
[snip]
: As it turned out, the one method that works is
: $foo = "\Qsomething\E";
: However I don't understand why neither of the following will work:
: $foo = '\\Qsomething\\E';
From perlop.pod (my emphasis):
----------------------------
For constructs that do interpolation, variables beginning with "C<$>"
^^^^^^^^^^^^^^^^^^^^^
or "C<@>" are interpolated, as are the following sequences.
...
\Q quote non-word characters till \E
^^^^^^^^^^^^^^^^^^^
----------------------------
Single quotes don't do interpolation, so \Q are two
literal characters there.
: $foo = "\\Qsomething\\E";
You have escaped the backslash, which instructs perl to not
put any meta-meaning on the following character.
That is, you have insisted that perl treat the backslash
as a literal backslash.
It needs to be a meta-backslash to introduce the quoting.
: And why then, when I print "\Qsomething\E" I don't see the
: backslashes?
Because it escapes non-word characters and that string
doesn't _have_ any non-word characters.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 05 Apr 1999 23:34:00 -0400
From: "Bill Jones" <bill@fccj.org>
Subject: Re: Cgi Communication with Layers?
Message-Id: <370980b5.0@usenet.fccj.cc.fl.us>
----------
In article <37086E31.97236555@primary.net>, William Tammen
<tazmen@primary.net> wrote:
<much snippage>
< Umm .. honestly, shouldn't you start thinking
in more than a couple of dimensions?
And I mean this in a positive way...
As an example of my good faith, ask Dan to
simply duplicate the original 'layer' success
for each successive layer. No? >
This is REALLY not a CGI group - No matter how badly you want it to be.
I'll give you a hint - then you really should ask in a CGI group, OK?
(Personally, I believe they will send you back here...)
Regardless of what you expect to see, all data must pass back thru
the server BEFORE it is sent out to the client.
*Write a filter* It may see which 'layers' you want, no?
You already stated Dan has been successful with one layer;
why not extend it to the 'nth' layer?
HTH,
-Sneex- :]
________________________________________________________________________
Bill Jones | FCCJ Webmaster | http://www.fccj.org/cgi/mail?webmaster
FCCJ | 501 W State St | Jacksonville, FL 32202 | 1 (904) 632-3089
Jacksonville Perl Mongers
http://jacksonville.pm.org
jax@jacksonville.pm.org
------------------------------
Date: Tue, 06 Apr 1999 07:24:35 GMT
From: rajesh_bhave@my-dejanews.com
Subject: CGI.pm - Doesn't recognize consecutive white spaces
Message-Id: <7eccre$bpv$1@nnrp1.dejanews.com>
Hello
CGI.pm doesn't recognize consecutive white spaces; this is why I don't get
consecutive spaces on the HTML generated by the CGI script. Any way to get
these spaces in HTML. Your help is highly appreciated.
Thanks and Regards
Rajesh Bhave
rajeshb@india.hp.com
bhaverajesh@hotmail.com
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 05 Apr 1999 12:27:29 -0600
From: Nathan Torkington <gnat@frii.com>
Subject: Conference paper deadline imminent
Message-Id: <m3d81ic48e.fsf@phoebe.frii.com>
Just a reminder to anyone interested in submitting a paper to the
Third Perl Conference: The deadline for paper submissions is April 9.
We want to get papers on big projects, clever hacks, funky extensions,
sexy embedding, life-saving text manglers, money-making CGI glue, your
plans for a Perlarola Perl-In-Hardware chip, and much more. Scare us.
Surprise us. Make us jealous.
We'd like extended abstracts. That is, an abstract with a detailed
outline of your paper. We need to know enough about your paper to
identify it as a keeper, and we found last year that a pure abstract
wasn't enough. You may submit code at this stage, but it is not
required.
Information about the conference is at http://conference.perl.com/
The address for submissions and questions is:
pc99submissions@perl.org
Cheers;
Nat
(followups set to comp.lang.perl.moderated)
------------------------------
Date: Tue, 06 Apr 1999 05:01:04 GMT
From: mitiaNOSPAM@nwu.edu (Dmitry Epstein)
Subject: Re: Counting files with various extentions
Message-Id: <370f9466.53802148@news.acns.nwu.edu>
On Thu, 1 Apr 1999 20:38:09 GMT, haginme@atl.bna.boeing.com (Michael
E. Hagin) wrote:
>Hello,
>
> I have written a perl script that will traverse a directory and
>count up the number of files that have various extentions
>(ex: .zip, .gz, .tif, ...). The problem is the find function will
>not traverse a link pointing to an automounted directory. Does anyone
>have any suggestions? Here is the code:
The documentation on File::Find says:
BUGS
There is no way to make find or finddepth follow symlinks.
Maybe this has something to do with your problem?
------------------------------
Date: Tue, 06 Apr 1999 04:59:52 GMT
From: smnayeem@my-dejanews.com
Subject: Re: Does anyone know how to do date/time functions in Perl
Message-Id: <7ec4c5$4fk$1@nnrp1.dejanews.com>
In article <MPG.117118fc53da2ddc989707@206.184.139.132>,
moseley@best.com (Bill Moseley) wrote:
> In article <7e72ff$1kg$1@nnrp1.dejanews.com>, agniora@usa.net says...
> > I looked in the FAQ and the CPAN, but the modules i need seem to be for Unix
> > only, but im running perl for NT, does anyone know what module to use and
> > where to get them from?
>
> I didn't see where is said in the FAQ that
> "How can I take a string and turn it into epoch seconds?"
> was unix specific.
>
> Is your date a fixed format? timelocal and localtime might get you
> started.
>
> --
> Bill Moseley mailto:moseley@best.com
Maybe i am wrong but most of the modules i have to download (eg Date::Calc)
comes in tar or gz format, those are for unix rnt they? and i know it might
be very simple to find it using timelocal and localtime, but i need some
examples to see how it works, everywhere i saw (FAQ, Camel book etc) the
examples are given on present time using the time() function. Where can i get
a more detailed description. can someone provide some examples specific to
this problem? thanks agniora
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Mon, 5 Apr 1999 22:55:21 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: Does anyone know how to do date/time functions in Perl
Message-Id: <MPG.117341a64b04a4a0989710@206.184.139.132>
In article <7ec4c5$4fk$1@nnrp1.dejanews.com>, smnayeem@my-dejanews.com
says...
> Maybe i am wrong but most of the modules i have to download (eg Date::Calc)
> comes in tar or gz format, those are for unix rnt they?
Nope. What perl are you running? If you told us that maybe we could
help you with modules (or try www.CPAN.org/modules/ and read the link
that says 'how to install modules')
> i am mainly looking for some function that would take a date formatted string
> as input and return the day for that date.
Again, if your "date formatted string" is a fixed format, then you don't
need to install any modules. Just split() out the information, pass the
bits to timelocal() to get a unix epoch seconds number, then pass that to
localtime() to get a list of values, one of which is the day.
timelocal() is part of the standard distribution - you should already
have it.
> and i know it might
> be very simple to find it using timelocal and localtime, but i need some
> examples to see how it works, everywhere i saw (FAQ, Camel book etc) the
> examples are given on present time using the time() function. Where can i get
> a more detailed description. can someone provide some examples specific to
> this problem? thanks agniora
try running perldoc -f localtime
and perldoc Time::Local
Try something, and if that doesn't work post again and INCLUDE what you
tried.
--
Bill Moseley mailto:moseley@best.com
------------------------------
Date: Mon, 5 Apr 1999 22:08:16 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Does anyone know whats wrong with my script?
Message-Id: <gaqbe7.mh.ln@magna.metronet.com>
Africa Ritter (revjack@radix.net) wrote:
: In tin, this thread looks like:
: 3 + Does anyone know whats wrong with my Larry Rosler <lr@hpl.hp.com>
You can't get lexical scope for Perl's special varia^H^H^H^H^H
people.
That should be "whats wrong with local Larry Rosler"
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 6 Apr 1999 09:56:57 +0100
From: "Chris Denman" <c-denman@dircon.co.uk>
Subject: flocking question - worried
Message-Id: <3709cc2e.0@glitch.nildram.co.uk>
Hi group,
Something is playing on my mind, and I hope someone out there can put my
mind at rest.
I have a simple counter file, which increases by one, and can be increased
by anyone at any time.
The flocking side of things is not a problem, I am just worried what happens
when a file is locked and the server crashes before the file is unlocked.
Will this file be forever locked, making that file not accessible -
effectively 'crashing' the whole file incrementing proceedure?
Comments would be greatly appreciated.
ChrisD
------------------------------
Date: Tue, 6 Apr 1999 01:25:26 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: here docs vs qq quote operator. Just personal preference?
Message-Id: <1dptbjo.14mnm271pz7rzwN@[207.60.170.55]>
David Delikat <ddelikat@protix.com> wrote:
>Abigail wrote:
> >
> <snip>
> >Abigail
> >--
> >perl -wleprint -eqq-@{[ -eqw\\\\- -eJust -eanother -ePerl -eHacker -e\\\\-]}-
>
> OK, what's up Abigail, that one didn't work. I just copy and paste
> in another X session and it gives me lots of perl errors.
Too many backslashes again. Abigail seems to have a bad habit of creating
clever JAPHs, then posting them without testing the final edits.
Either that or Abigail has a really weird shell. :)
perl -wleprint -eqq-@{[ -eqw\\- -eJust -eanother -ePerl -eHacker -e\\-]}-
--
_ / ' _ / - aka -
( /)//)//)(//)/( Ronald J Kimball rjk@linguist.dartmouth.edu
/ http://www.tiac.net/users/chipmunk/
perl -e '$_="\012534`!./4(%2`\cp%2,`(!#+%2j";s/./"\"\\c$&\""/gees;print'
------------------------------
Date: Tue, 6 Apr 1999 01:25:28 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: here docs vs qq quote operator. Just personal preference?
Message-Id: <1dptbrh.1ovwcjh8frm7rN@[207.60.170.55]>
Uri Guttman <uri@home.sysarch.com> wrote:
> here docs are called that because of their ancestry from sh. there they
> were documents that were 'here' and not in a file, that were fed into
> stdin. perl uses them as alternative string quotes and should use a
> different name. i have seen word/line delimited/quoted strings. any
> ideas on a better term for them?
here strings? :)
--
_ / ' _ / - aka -
( /)//)//)(//)/( Ronald J Kimball rjk@linguist.dartmouth.edu
/ http://www.tiac.net/users/chipmunk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Mon, 5 Apr 1999 19:21:59 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: here docs vs qq quote operator. Just personal preference?
Message-Id: <nigbe7.0pv.ln@magna.metronet.com>
Uri Guttman (uri@home.sysarch.com) wrote:
: here docs are called that because of their ancestry from sh. there they
: were documents that were 'here' and not in a file, that were fed into
: stdin. perl uses them as alternative string quotes and should use a
: different name. i have seen word/line delimited/quoted strings. any
: ideas on a better term for them?
"there docs"?
It is there <pointing>, between the delimiter strings.
"their docs"?
It is there <pointing>, in someone else's code.
"they're docs"?
An existential form of quoting.
"binary mode docs"?
You know, the quoting that breaks when I FTP the program.
:-)
"multi-line quotes/docs"
( "multi-line" outscores "multiline" 24 to 10 in the *.pod files )
I think working "quote" into the name would help conceptually.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 05 Apr 1999 15:35:03 -0700
From: Jerome O'Neil <jeromeo@atrieva.com>
Subject: Re: here docs vs qq quote operator. Just personal preference?
Message-Id: <37093A97.3A16AD55@atrieva.com>
Sean McAfee wrote:
> Early in my Perl career I went through a phase when I religiously used
> double quotes only when interpolation made them necessary. It didn't last
> long, because it was really irritating switching quote types whenever I
> needed to add an interpolated variable or escape sequence to a single-quoted
> string, or remove the last interpolated variable or escape sequence from
> a double-quoted string. To avoid this hassle, I tend to use double quotes
> everywhere.
This is why quote and quote-like metacharacters are a Good Thing. It's
much easier to change q{foo} to qq{$foo} than the similar change using
single and double quotes. You might find the "Gory Details of Parsing
Quoted Constructs" in perlop interesting reading.
--
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947
The Atrieva Service: Safe and Easy Online Backup http://www.atrieva.com
------------------------------
Date: Mon, 05 Apr 1999 15:55:42 -0700
From: Jerome O'Neil <jeromeo@atrieva.com>
To: Moritz <Moritz@warzone.com>
Subject: Re: How do I simply delete a file in CGI?
Message-Id: <37093F6E.27F31293@atrieva.com>
Moritz wrote:
>
> Am I stupid, or did they really forget to put that in the Perl language
> reference?
Neither, it's just not called 'delete.' What you want is 'unlink.' For
all the exciting details on unlink, and other functions for files,
filehandles, and directories, check out the perlfunc document that came
with your perl distribution.
Good Luck!
--
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947
The Atrieva Service: Safe and Easy Online Backup http://www.atrieva.com
------------------------------
Date: Tue, 06 Apr 1999 06:42:56 GMT
From: agniora@usa.net
Subject: How to check for benchmark speed of a program?
Message-Id: <7ecadf$983$1@nnrp1.dejanews.com>
If i want to check how long it takes to do a certain task for a program, how
can i do it? eg to test the total time taken of the following program : $_ =
'This is a text'; print tr/ //;
thanks
agniora
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 6 Apr 1999 10:49:38 +0200
From: "arie" <arie@kba.org.il>
Subject: perl 509 and iis
Message-Id: <923389104.914072@data.kba.org.il>
for some reson after i install perl 509 on IIS4 the IIS stope responding
after a problem with perl. the fermer one (504) did use alot of virtual
memory for the sme program, but dident stop the IIS.
how can i stop the problem?
------------------------------
Date: Mon, 5 Apr 1999 19:36:20 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Pick one of two files
Message-Id: <kdhbe7.0pv.ln@magna.metronet.com>
David L. Cassell (cassell@mail.cor.epa.gov) wrote:
: Scribbles wrote:
: > This is probably pretty basic; can I have an <A HREF> point to a cgi
: > script that will display one file if it exists, another if it doesn't,
: > and if so, any examples anywhere around? TIA.
: Oops, sorry, but you're asking this in the wrong newsgroup.
: Even if your program is written in Perl. Really.
I think it was a Perl question.
Ignore the first quoted line above, reread the rest.
Could be a Perl script in just about any environment...
Of course, tweeking for a CGI environment would be off
topic here though.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 6 Apr 1999 01:25:34 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Return value undef, but with || undef'ed value, result = 1?
Message-Id: <1dptdr9.11qb5ws1vmhdwtN@[207.60.170.55]>
Justin Masters - remove y to reply <jmastyers@pcocd2.intel.com> wrote:
> I have the following code that is puzzling me:
>
>
> ($nbcl) = &checkargsoneval('nbcl') || $NBCL;
>
> $NBCL = undef under debugger.
> nbcl is not an argument, which this subroutine checks for. The last
> statement of the subroutine says:
>
> return(@returnvals);
>
> In debugger, @returnvals is undef as well.
>
> However, $nbcl = 1, when I run the debugger.
If @returnvals really is the list (undef), then your subroutine returns
the value 1 in that code. The function call is in a scalar context,
which means you return scalar(@returnvals), which is the number of
elements in @returnvals, which is 1.
If you want to return a false value, then @returnvals should be the
empty list, not the one-element list (undef).
--
chipmunk (Ronald J Kimball) <rjk@linguist.dartmouth.edu>
perl -e 'print map chop, sort split shift, reverse shift
' 'j_' 'e._jP;_jr/_je=_jk{_jn*_j &_j :_j @_jr}_ja)_js$_j
~_jh]_jt,_jo+_jJ"_jr>_ju#_jt%_jl?_ja^_jc`_jh-_je|' -rjk-
------------------------------
Date: Tue, 06 Apr 1999 04:47:35 -0400
From: brian@pm.org (brian d foy)
Subject: Re: Script to run ftp
Message-Id: <brian-ya02408000R0604990447350001@news.panix.com>
In article <Pine.A41.4.10.9904052116250.16652-100000@dante04.u.washington.edu>, "R. Riley" <rileyr@u.washington.edu> posted:
> Does anyone have any perl scripts to run ftp (for downloading multiple
> files) on unix? Thanks.
i think Graham Barr does. ;) look for the libnet bundle on CPAN, which
include Net::FTP.
<URL:http://www.cpan.org>
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>
------------------------------
Date: Mon, 5 Apr 1999 19:24:37 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Speed of PERL
Message-Id: <lngbe7.0pv.ln@magna.metronet.com>
David L. Cassell (cassell@mail.cor.epa.gov) wrote:
: My version of Net::ESP isn't
: working now.
I knew that.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 5 Apr 1999 19:50:39 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Using Perl For ErrorDocuments
Message-Id: <f8ibe7.0pv.ln@magna.metronet.com>
Tyler Hutcheon (hutcheon@iaw.on.ca) wrote:
: I am experienced in perl and unix,
But not Usenet.
You have landed in the wrong newsgroup.
: Simulated Error: works fine
: Real Error: 404 screen with 500 on the errordocument
Perl does not have any error messages like that.
You can tell by searching for messages in the perldiag.pod
man page that comes with perl. It lists all of the messages
that perl might issue.
If it is not in perldiag.pod, then it did not come from perl.
: Is there anything special needed for responding to the error? HTML
: headders, etc?
You should ask HTML questions in:
comp.infosystems.www.authoring.html
You should ask CGI questions in:
comp.infosystems.www.authoring.cgi
You should ask Perl questions here.
: Can I use a 1; at the end of the file?
Yes. (WHWYTI?)
: will this effect the run?
Can't tell. You didn't include the code.
: Can Full Query Strings be used in the .htaccess? ie:
Perl doesn't have an .htaccess
You should ask CGI questions in:
comp.infosystems.www.authoring.cgi
: ErrorDocument 404 error.cgi?err=404
: ..or does it have to be..
: ErrorDocument 404 error.cgi?404
: ..or can I use them?
: ErrorDocument 404 error.cgi
: ..is there a variable that says the errorcode, like
: $ENV{'REQUEST_REASON'}?
If there is, it is defined by the CGI spec, not by Perl.
You should ask CGI questions in:
comp.infosystems.www.authoring.cgi
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 6 Apr 1999 01:25:35 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Very large regular expressions
Message-Id: <1dptfb9.c8z3plq56ggkN@[207.60.170.55]>
Sean McAfee <mcafee@waits.facilities.med.umich.edu> wrote:
> In article <1dpnz0b.1uuzc3f1od83jaN@p95.block1.tc5.state.ma.tiac.net>,
> Ronald J Kimball <rjk@linguist.dartmouth.edu> wrote:
> >This won't work if you have capturing parentheses on different sides of
> >an alternative:
>
> True. As I mentioned, some care is required in writing the regex.
Ah, so you did, I think I overlooked that bit the first time. :)
> >You could assign the results of the match to a list instead:
>
> >return unless @matches = $letter =~ $regex;
> >$hash{$keys->[$i]} = $matches[$i] for $i (0 .. $#matches);
>
> I thought this looked spiffier than what I had, so I incorporated it into
> my code, and was promptly surprised by a property of the match operator
> that I hadn't known about before; namely, the way it behaves in array
> context when there are no capturing parentheses in the regex:
>
> @match = "foo" =~ /foo/;
>
> @match now has a single element, "1". Since some lines of my big regex
> have no parentheses, I must go back to something like my original code.
Yeah, matching and context and capturing parentheses and return values
is a bit of a mess. :/
The match has to return some sort of true value if it succeeds, though,
so I guess the list (1) is the best it can do when there are no
capturing parentheses.
> I did streamline it a bit, though:
>
> $i = 0; $hash{$keys[$n++]} = $$i while defined ${++$i};
>
> >> }
> >> $letter = $';
>
> >Isn't this just another way of doing scalar(m//g)?
>
> No, because I'm matching against a different regex each time through the
> loop.
So? Isn't that just another way of doing scalar(m//g)?
There is no inherent requirement in using m//g that the regex has to be
the same every time.
--
#!/usr/bin/sh -- chipmunk (aka Ronald J Kimball)
perl -s -e 'print sort grep {/\s/g} keys %main::
' -- -is -' Just' -' another ' -'Perl ' -'hacker
' http://www.tiac.net/users/chipmunk/ [rjk@linguist.dartmouth.edu]
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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.misc (and this Digest), send your
article to perl-users@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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 5307
**************************************