[11705] in Perl-Users-Digest
Perl-Users Digest, Issue: 5305 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Apr 5 21:06:26 1999
Date: Mon, 5 Apr 99 18:00:19 -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 Mon, 5 Apr 1999 Volume: 8 Number: 5305
Today's topics:
Re: Backslash: unclear on the concept <aperrin@mcmahon.qal.berkeley.edu>
Re: Backslash: unclear on the concept (Abigail)
Re: Backslash: unclear on the concept (Larry Rosler)
Re: constructing a list of hashes <jglascoe@giss.nasa.gov>
Re: constructing a list of hashes <uri@home.sysarch.com>
Cookies (. .)
Re: Does anyone know whats wrong with my script? <aperrin@mcmahon.qal.berkeley.edu>
Re: Does anyone know whats wrong with my script? (Bill Moseley)
First CGI/Perl Program <erikjt@earthlink.net>
Re: Form Submission - Multi <cassell@mail.cor.epa.gov>
HELP! How do I pass variables? mr_potato_head@my-dejanews.com
Re: How do I turn this 1000000 into this 1,000,000 in P <cassell@mail.cor.epa.gov>
Re: Numbness and tingling in lower limbs (brian d foy)
Re: perl and y2k (was Re: The millennium cometh -- even <cassell@mail.cor.epa.gov>
Re: perl and y2k (was Re: The millennium cometh -- even (Sam Holden)
Re: Premature end of script headers <uri@home.sysarch.com>
Re: Premature end of script headers (Larry Rosler)
Re: Premature end of script headers <cassell@mail.cor.epa.gov>
Re: Premature end of script headers <cassell@mail.cor.epa.gov>
Re: Premature end of script headers (Larry Rosler)
Re: Premature end of script headers (Larry Rosler)
Re: PROGRESS Data Base and Perl ? <kperrier@blkbox.com>
Rand to Whole Number (Immot5)
Re: Rand to Whole Number (Sam Holden)
Re: This proverbial "perldoc". (Larry Rosler)
Re: This proverbial "perldoc". (Abigail)
Re: Using Perl For ErrorDocuments (brian d foy)
XMODEM Protocol From Perl garthwebb@my-dejanews.com
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 05 Apr 1999 16:18:33 -0700
From: Andrew Perrin <aperrin@mcmahon.qal.berkeley.edu>
Subject: Re: Backslash: unclear on the concept
Message-Id: <370944C9.2233B699@mcmahon.qal.berkeley.edu>
What do you mean by "doesn't work?"
On my system,
$foo = "\\Qsomething\\E";
print $foo;
returns:
\Qsomething\E
so does:
$foo = '\\Qsomething\\E';
print $foo;
Here's the rule as I understand it:
- Within double quotes, backslash followed by most characters is
replaced with the character following the backslash, e.g.:
\Q => Q
\' => '
\\ => \
- This does not hold for characters with special meanings, for example
\n which returns a newline.
- Within single quotes, the backslash is usually printed, except when
preceding \ or ', in which case it does the same thing it does in double
quotes.
ap
Dmitry Epstein 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.
>
> 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/
>
> 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';
> $foo = "\\Qsomething\\E";
>
> And why then, when I print "\Qsomething\E" I don't see the
> backslashes?
--
-------------------------------------------------------------
Andrew J. Perrin - NT/Unix/Access Consulting - (650)938-4740
aperrin@mcmahon.qal.berkeley.edu (Remove the Junk Mail King)
http://www.geocities.com/SiliconValley/Grid/7544/
-------------------------------------------------------------
------------------------------
Date: 6 Apr 1999 00:36:21 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Backslash: unclear on the concept
Message-Id: <7ebku5$s1e$1@client2.news.psi.net>
Andrew Perrin (aperrin@mcmahon.qal.berkeley.edu) wrote on MMXLIII
September MCMXCIII in <URL:news:370944C9.2233B699@mcmahon.qal.berkeley.edu>:
[ Please put a followup *AFTER* the part you quote, that makes it a
lot easier to follow. English is written left to right, top to bottom,
not bottom to top ]
## 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
##
## Here's the rule as I understand it:
## - Within double quotes, backslash followed by most characters is
## replaced with the character following the backslash, e.g.:
## \Q => Q
## \' => '
## \\ => \
## - This does not hold for characters with special meanings, for example
## \n which returns a newline.
I think neither you nor Dmitry realize that \Q and \E have a specific
meaning in interpolated strings.
Abigail
--
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
"\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
"\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'
------------------------------
Date: Mon, 5 Apr 1999 17:45:17 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Backslash: unclear on the concept
Message-Id: <MPG.1172f8f3edda635398983f@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <370944C9.2233B699@mcmahon.qal.berkeley.edu> on Mon, 05 Apr
1999 16:18:33 -0700, Andrew Perrin <aperrin@mcmahon.qal.berkeley.edu>
says...
...
> Here's the rule as I understand it:
> - Within double quotes, backslash followed by most characters is
> replaced with the character following the backslash, e.g.:
> \Q => Q
Sorry, no. See below.
> \' => '
> \\ => \
> - This does not hold for characters with special meanings, for example
> \n which returns a newline.
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):
\l lowercase next char
\u uppercase next char
\L lowercase till \E
\U uppercase till \E
\E end case modification
\Q quote non-word characters till \E
It's a good idea not to prefix any letter with a backslash unless you
want to get at its special meaning. Who knows, some day it may acquire
one!
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Mon, 05 Apr 1999 18:53:46 -0400
From: Jay Glascoe <jglascoe@giss.nasa.gov>
Subject: Re: constructing a list of hashes
Message-Id: <37093EFA.32AAFF42@giss.nasa.gov>
Jay Glascoe wrote:
>
> code_3 => sub { @hash{keys %hash} = (0) x (keys(%hash) / 2) },
oops, should have read Larry's post:
code_3 => sub { @hash{keys %hash} = (0) x keys %hash },
and for pedantry, let's add:
code_5 => sub { $$_ = 0 foreach \(values %hash) },
yielding:
Benchmark: timing 10 iterations of code_1, code_2, code_3, code_4, code_5...
code_1: 3 wallclock secs ( 2.74 usr + 0.01 sys = 2.75 CPU)
code_2: 1 wallclock secs ( 0.89 usr + 0.00 sys = 0.89 CPU)
code_3: 3 wallclock secs ( 2.72 usr + 0.00 sys = 2.72 CPU)
code_4: 3 wallclock secs ( 2.97 usr + 0.00 sys = 2.97 CPU)
code_5: 1 wallclock secs ( 1.66 usr + 0.00 sys = 1.66 CPU)
Anyway, I'd like to point out that had I known "code_2" only
worked for perl5.005_52+, I wouldn't have posted it. I always
test my code in the debugger (well, except for the times that
I don't ;^) and just assumed it was viable perl5.005 code.
BTW, my documentation doesn't seem to mention anything about
"values()" producing lvalues.
>
> Jay Glascoe
------------------------------
Date: 05 Apr 1999 19:04:21 -0400
From: Uri Guttman <uri@home.sysarch.com>
Subject: Re: constructing a list of hashes
Message-Id: <x7wvzqu0sq.fsf@home.sysarch.com>
>>>>> "JG" == Jay Glascoe <jglascoe@giss.nasa.gov> writes:
JG> [courtesy copy of post sent to cited author]
JG> Uri Guttman wrote:
>> @hash{keys %hash} = (0) x (keys %hash / 2);
>>
JG> but the [missing] parens around %hash are not optional ;^)
in the second keys hash? anyway larry found my stupid error there and
the /2 is wron so there should just be keys %hash.
JG> code_1 => sub { $_ = 0 foreach @hash{keys %hash} },
JG> code_2 => sub { $_ = 0 foreach values %hash },
JG> code_3 => sub { @hash{keys %hash} = (0) x (keys(%hash) / 2) },
JG> code_4 => sub { $hash{$_} = 0 foreach keys %hash },
JG> code_1: 2 wallclock secs ( 2.79 usr + 0.00 sys = 2.79 CPU)
JG> code_2: 1 wallclock secs ( 0.91 usr + 0.00 sys = 0.91 CPU)
JG> code_3: 3 wallclock secs ( 2.48 usr + 0.00 sys = 2.48 CPU)
JG> code_4: 3 wallclock secs ( 2.98 usr + 0.00 sys = 2.98 CPU)
this make sense as the hash slice methods need to build up lists and the
foreach method doesn't. but my post about this being unsupported in
stable perls is very valid. this should not be used unless its is out
and documented. the patch that made it work was not intended or this feature.
comment: when you do benchmarks like these, use better names like
for_slice
for_vals
keys_slice
for_keys
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Mon, 5 Apr 1999 18:31:21 -0600 (MDT)
From: TipTup@webtv.net (. .)
Subject: Cookies
Message-Id: <20655-370955D9-4@newsd-134.iap.bryant.webtv.net>
Does anyone have any cookie libraries or an example on how to
set/retrieve cookies? I tried MSA's cookie.lib but it generated the
error:
Premature end of script headers
when I added the cookie functions.. ?
Email me if youcan..
------------------------------
Date: Mon, 05 Apr 1999 16:03:40 -0700
From: Andrew Perrin <aperrin@mcmahon.qal.berkeley.edu>
Subject: Re: Does anyone know whats wrong with my script?
Message-Id: <3709414C.BD52F511@mcmahon.qal.berkeley.edu>
I still think the syntax error has to do with the difference between
Sub foo {
and
sub foo {
....
Andy
smnayeem@my-dejanews.com wrote:
> In article <MPG.1171e779cb7962cc989709@206.184.139.132>,
> moseley@best.com (Bill Moseley) wrote:
> > In article <7e9fbr$t8h$1@nnrp1.dejanews.com>, agniora@usa.net says...
> > > I wrote a function to find the weekday of a given date.
> >
> > I'd use timelocal and localtime to do that work.
> >
> > > #my $Onlydate = @_;
> >
> > Eh, I don't think you want the count of the number of elements in @_?
> >
> > --
> > Bill Moseley mailto:moseley@best.com
> >
> i tried it again replacing @_ with @_[0] but it says syntax error on the next
> line. i cant figure out any "syntax errors" on the later portion.
>
> and i also tried to get myself to understand the localtime and the timelocal
> very hard, i looked at the FAQ, the Camel etc but i cant seem to be able to
> figure out how my particular problem can be solved, i know its possible with
> those but the examples and explanations they have are inadequate. can someone
> show me how it (finding a day from a date) can be done with the help of
> localtime and timelocal with some examples. thanks agniora
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
--
-------------------------------------------------------------
Andrew J. Perrin - NT/Unix/Access Consulting - (650)938-4740
aperrin@mcmahon.qal.berkeley.edu (Remove the Junk Mail King)
http://www.geocities.com/SiliconValley/Grid/7544/
-------------------------------------------------------------
------------------------------
Date: Mon, 5 Apr 1999 17:39:46 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: Does anyone know whats wrong with my script?
Message-Id: <MPG.1172f7a1f7a8f57498970f@206.184.139.132>
In article <MPG.1172a424740f309a989830@nntp.hpl.hp.com>, lr@hpl.hp.com
says...
> [Posted and a courtesy copy mailed.]
>
> In article <MPG.117269ad8c19e54198970a@206.184.139.132> on Mon, 5 Apr
> 1999 07:33:59 -0700, Bill Moseley <moseley@best.com> says...
> ...
> > Passing in a single variable I'd use
> >
> > $Onlydate = $_;
>
> I wouldn't use that, as it has nothing to do with passing variables into
> subroutines.
I was just checking to see if I was in your kill file, Larry ;) Sorry
for the error.
> I'd use
>
> $Onlydate = $_[0];
So, do you like it better than
$Onlydate = shift;
--
Bill Moseley mailto:moseley@best.com
------------------------------
Date: Mon, 5 Apr 1999 16:45:16 -0700
From: "Erik Thompson" <erikjt@earthlink.net>
Subject: First CGI/Perl Program
Message-Id: <7ebi32$9f$1@oak.prod.itd.earthlink.net>
I am get an Internal Server Error when I try to run this simple Hello World
program from my browser.
I have accessed my site from Telnet and when I tried to run it by typing
'perl helloworld.cgi' it first said that I had illegal carriage returns at
the second line.
I removed all the carriage returns and then typed 'perl helloworld.cgi'
again and it seems to work okay. However when I just type 'helloworld.cgi'
I get 'No such file or directory'.
Does this mean that the first line in this program is wrong?
I have also tried it with '#!/usr/bin/perl' and it still does not work.
Does anyone know what I am doing wrong?
#!/usr/local/bin/perl
print "Content-type: text/html\n\n";
print "<html>\n";
print "<head>\n";
print "<title>Hello world with Perl</title>\n";
print "</head>\n";
print "<body>\n";
print "<h1>Hello world with Perl</h1>\n";
print "<p>Howdy, world!</p>\n";
print "</body>\n";
print "</html>\n";
------------------------------
Date: Mon, 05 Apr 1999 17:04:07 -0700
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
Subject: Re: Form Submission - Multi
Message-Id: <37094F77.5DE335FD@mail.cor.epa.gov>
Eric The Read wrote:
> "Bruce Davidson" <bruce.d@btinternet.com> writes:
> > Is there any way to submit the variables from one cgi generated form to two
> > different scripts which occupy two different frames.
>
> Is there any reason you didn't ask this in comp.infosystems.www.cgi,
---> comp.infosystems.www.authoring.cgi
> where it's appropriate?
>
> -=Eric. It's a rhetorical question, see?
I assume that's what you meant. Typo or braino? [also rhetorical, BTW]
David
--
David L. Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Mon, 05 Apr 1999 23:25:17 GMT
From: mr_potato_head@my-dejanews.com
Subject: HELP! How do I pass variables?
Message-Id: <7ebgok$klb$1@nnrp1.dejanews.com>
Hi,
I know how to pass perl variables at the command line but I don't know how
from a web page. I have the following code in my link on my web page:
<TR>
<TD><A HREF="../../cgi-bin/index.cgi
/u1/network/data/omcr1_cbsc1/monsey_reports" TARGET="main"><FONT
COLOR="#0000A0">Daily Cdl Analysis</FONT></A></TD>
</TR>
And the following code in my cgi-bin:
#!/usr/local/bin/perl $report_directory = $ARGV[0];
chdir("$report_directory"); @directorylisting = `ls -1`; foreach $file
(@directorylisting) { $dirlisting= "$dirlisting <a href=
$report_directory/$file TARGET=newwin>$title $file</a><br>"; } print
"Content-type: text/html\n\n"; print "<title>Index of directory</title> <body
bgcolor=ffffff text=0080FF> <center><big><big><font face=arial>Select a
Report From the Following...</big></big></font><br> <hr><br> <hr><br>
$report_directory<br> $dirlisting<br> <hr>\n"; exit;
Everytime I run this it only gives me a directory listing of my cgi-bin. Can
anyone tell or show me how to pass my variables from my link to my cgi script?
Thanks in advance...
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Mon, 05 Apr 1999 17:10:54 -0700
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
Subject: Re: How do I turn this 1000000 into this 1,000,000 in Perl?
Message-Id: <3709510E.C7A0A70D@mail.cor.epa.gov>
IndexFinger.com wrote:
> How do I turn this 1000000 into this 1,000,000 in Perl?
>
> --
> ==================================================
> SuggestSite - http://www.suggestsite.com
> Word of mouth is the most powerful marketing tool.
Umm, do you mean how do you format a number to have commas
in the right place? Then you should look in perlfaq5:
"How can I output my numbers with commas added?"
If you mean, how do you write a number like that in your
code when Perl will treat your commas as list separators,
then you do this:
1_000_000
David
--
David L. Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Mon, 05 Apr 1999 19:44:06 -0400
From: brian@pm.org (brian d foy)
Subject: Re: Numbness and tingling in lower limbs
Message-Id: <brian-ya02408000R0504991944060001@news.panix.com>
In article <19990405095326.15315.00002939@ng-cc1.aol.com>, rbjrt@aol.com (RBJRT) posted:
> I expected to learn something about this subject as I thought I logged on to
> medhelp.org. What happened?
you actaully have to log on, rather than just thinking about it.
does this have anything to do with Perl, other than getting carpal
tunnel syndrome fromtoo much hacking?
--
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, 05 Apr 1999 17:00:50 -0700
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
Subject: Re: perl and y2k (was Re: The millennium cometh -- eventually)
Message-Id: <37094EB2.A7B545E3@mail.cor.epa.gov>
George wrote:
> In article <19990331.215239.5N7.rnr.w164w@locutus.ofB.ORG>, Russell Schulz
> <Russell_Schulz@locutus.ofB.ORG> wrote:
>
> > "David L. Cassell" <cassell@mail.cor.epa.gov> writes:
> >
> > >> again: this is why I disagree with the FAQ. I have never seen a
> > >> pencil that would surprise a user (who, shockingly, hadn't memorized
> > >> its manual) by writing 100 when referring to 2000.
> > >
> > > Oh no! He's right! All programming languages are Y2K noncompliant,
> > > since someone somewhere can misuse them!
> >
> > I see a big difference between `can misuse' and `will misuse, if using the
> > natural way provided'.
> >
> > Does your response mean:
> >
> > a. You don't understand this difference?
> > b. You don't think the difference is real?
> > c. You think the difference won't affect real code?
> > d. You just wanted to make a Unabomber post?
> > e. Other...?
> > --
> > Russell_Schulz@locutus.ofB.ORG Shad 86c
>
> The fact of the matter is, it's not that big of a deal to change the date
> from 100 to 2000. Here's the code I've used again and again.. it works for
> me, but no guarantees about its greatness, eh? ;-)
>
> ####CODE START####
> ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
> $unix_time = time();
> @months =
> ("Jan.","Feb.","Mar.","Apr.","May","June","July","Aug.","Sep.","Oct.","Nov.",
> "Dec.");
>
> $is_2000 = 0;
> if ($year>=100) { $is_2000 = 1;
> $year = $year - 100; }
> if ($year<10) { $year = "0" . "$year"; }
> if ($is_2000) { $year = "20" . "$year"; }
> if ($year<100) { $year = "19" . "$year"; }
>
> $date = "$months[$mon] $mday $year";
> ####CODE END######
>
> That gives a nicely formatted date.. like 1999 or 2003.. could add a
> weekday name like the month name by just making a
> 'sunday,monday...etc...friday,saturday' array and using $wdaysarray[$wday].
George, I don't want to be difficult, but wouldn't it be easier
just to say:
$year += 1900;
I think you just proved Russell's point. :-)
David
--
David L. Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: 6 Apr 1999 00:32:34 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: perl and y2k (was Re: The millennium cometh -- eventually)
Message-Id: <slrn7gilh2.k36.sholden@pgrad.cs.usyd.edu.au>
David L. Cassell <cassell@mail.cor.epa.gov> wrote:
>George wrote:
>>
>> $is_2000 = 0;
>> if ($year>=100) { $is_2000 = 1;
>> $year = $year - 100; }
>> if ($year<10) { $year = "0" . "$year"; }
>> if ($is_2000) { $year = "20" . "$year"; }
>> if ($year<100) { $year = "19" . "$year"; }
>>
>> That gives a nicely formatted date.. like 1999 or 2003..
>
>George, I don't want to be difficult, but wouldn't it be easier
>just to say:
> $year += 1900;
>
Also what happens if through some strange twist not only are people
still alive, and the calender hasn't been changed, but perl is still
being used in 2100?
Of course we won't be using 32 bit time_t's then. As if. That'd be
like still using two digit dates in the year 1999...
--
Sam
There's no such thing as a simple cache bug.
--Rob Pike
------------------------------
Date: 05 Apr 1999 19:14:25 -0400
From: Uri Guttman <uri@home.sysarch.com>
Subject: Re: Premature end of script headers
Message-Id: <x7soaeu0by.fsf@home.sysarch.com>
>>>>> "RLS" == Randal L Schwartz <merlyn@stonehenge.com> writes:
>>>>> "Larry" == Larry Rosler <lr@hpl.hp.com> writes:
Larry> Can you point to a use of P[eE][rR][lL] as an acronym in any of the
Larry> official Perl docs? I know it isn't in perlfaq1.
RLS> You're gonna scream when you see how easy it is to answer you!
RLS> perldoc perl =>
RLS> NAME
RLS> perl - Practical Extraction and Report Language
RLS> [...]
RLS> Perl actually stands for Pathologically Eclectic Rubbish
RLS> Lister, but don't tell anyone I said that.
aren't those "retronyms" or acronyms made up after the word existed.
my favorite (or really most hated) is ping which got its name from the
ping used by submarine sonar which would echo back from submerged
objects. it was never an acronym, but i have seen in print (it must be
true! :-) the acronym 'packet internet groper', about as absurd a
definition as one could hope for.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Mon, 5 Apr 1999 16:40:51 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Premature end of script headers
Message-Id: <MPG.1172e9e046dd29fa98983c@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <m1zp4mad7k.fsf@halfdome.holdit.com> on 05 Apr 1999 15:56:31
-0700, Randal L. Schwartz <merlyn@stonehenge.com> says...
> >>>>> "Larry" == Larry Rosler <lr@hpl.hp.com> writes:
>
> Larry> Can you point to a use of P[eE][rR][lL] as an acronym in any of the
> Larry> official Perl docs? I know it isn't in perlfaq1.
>
> You're gonna scream when you see how easy it is to answer you!
>
> perldoc perl =>
>
> NAME
> perl - Practical Extraction and Report Language
> [...]
> Perl actually stands for Pathologically Eclectic Rubbish
> Lister, but don't tell anyone I said that.
SCREEEEAM!!!!! (But sssh -- it's a secret :-)
Now I'm frantically searching the Web and my bookshelf for anyplace
where The Real Larry disavows that. Help, anyone???
(The Blue Camel, p. 555, implies that it is a retro-acronym from
'Pearl', which is quite believable. Basic is obviously such a beast,
while Cobol and Fortran obviously are not. And then there is C. :-)
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Mon, 05 Apr 1999 16:47:29 -0700
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
Subject: Re: Premature end of script headers
Message-Id: <37094B91.7C7AF782@mail.cor.epa.gov>
Larry Rosler wrote:
> In article <370925F1.6BFF461C@mail.cor.epa.gov> on Mon, 05 Apr 1999
> 14:06:57 -0700, David L. Cassell <cassell@mail.cor.epa.gov> says...
> ...
> > ... BTW, you might be interested that Perl is traditionally
> > spelled with one cap and three lowercased letters.. even though it
> > is an acronym. That was done on purpose to warn the unwary. :-)
>
> Can you point to a use of P[eE][rR][lL] as an acronym in any of the
> official Perl docs? I know it isn't in perlfaq1.
I don't need to answer this, since Randal already addressed it.
I'm just putting this in so Randal can see *one* post this month with his
name spelled correctly. :-)
> What some authors may have printed on book jackets or introductions
> doesn't count.
>
> If Perl were an acronym, it would be spelled with all caps. (I know
> that some acronyms, such as BASIC and COBOL, existed; but as they have
> become more widely known, they have downcased into normal usage to
> divert attention from the acronymic origins. Unix was spelled UNIX for
> trademark purposes, but was never an acronym.)
Oooh! I get to disagree with Larry! :-)
According to my dictionary, acronym is: 'a word (such as radar or snafu)
formed from the initial letter or letters of each of the successive parts
or major parts of a compound term'. No requirement for capitalization.
APL is not an acronym because it is not a pronounceable word. SNOBOL is.
I almost said QED here, but that might start another sub-thread. :-)
David
--
David L. Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Mon, 05 Apr 1999 16:51:45 -0700
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
Subject: Re: Premature end of script headers
Message-Id: <37094C91.D1F64706@mail.cor.epa.gov>
Uri Guttman wrote:
> >>>>> "RLS" == Randal L Schwartz <merlyn@stonehenge.com> writes:
> >>>>> "Larry" == Larry Rosler <lr@hpl.hp.com> writes:
> Larry> Can you point to a use of P[eE][rR][lL] as an acronym in any of the
> Larry> official Perl docs? I know it isn't in perlfaq1.
>
> RLS> You're gonna scream when you see how easy it is to answer you!
>
> RLS> perldoc perl =>
>
> RLS> NAME
> RLS> perl - Practical Extraction and Report Language
> RLS> [...]
> RLS> Perl actually stands for Pathologically Eclectic Rubbish
> RLS> Lister, but don't tell anyone I said that.
>
> aren't those "retronyms" or acronyms made up after the word existed.
As I understand the origins of the language, the first is an acronym
while the second is a retronym.. as we say in the 'folk etymology' biz...
> my favorite (or really most hated) is ping which got its name from the
> ping used by submarine sonar which would echo back from submerged
> objects. it was never an acronym, but i have seen in print (it must be
> true! :-) the acronym 'packet internet groper', about as absurd a
> definition as one could hope for.
There are also truly awful retronyms for non-computer words, such
as 'posh' and 'blimp' and, umm.. pardon my French, but 'f@ck'.
David "'Port Outward, Starboard Home'? Yes milord. As you wish."
--
David L. Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Mon, 5 Apr 1999 16:55:42 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Premature end of script headers
Message-Id: <MPG.1172ed5843407c9a98983d@nntp.hpl.hp.com>
In article <x7soaeu0by.fsf@home.sysarch.com> on 05 Apr 1999 19:14:25 -
0400, Uri Guttman <uri@home.sysarch.com> says...
> >>>>> "RLS" == Randal L Schwartz <merlyn@stonehenge.com> writes:
...
> RLS> perl - Practical Extraction and Report Language
> RLS> [...]
> RLS> Perl actually stands for Pathologically Eclectic Rubbish
> RLS> Lister, but don't tell anyone I said that.
>
> aren't those "retronyms" or acronyms made up after the word existed.
Too late a coinage for my dictionaries. However, from
<URL:http://members.aol.com/WorldofI/useless_English.html>:
"A retronym is a word which was coined because of another
similar word... well it's hard to explain. Here are some
examples: HARD-COVER BOOK used to be called "book" before
paperback books were invented. Also, ACOUSTIC GUITAR came
from guitar once electric guitars were invented."
Here's another example: "snow skiing" vs. "skiing".
That's why I called things like Basic 'retro-acronyms' in my response to
Randal.
And now, back to 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 17:35:36 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Premature end of script headers
Message-Id: <MPG.1172f6b8d1dda58498983e@nntp.hpl.hp.com>
In article <37094B91.7C7AF782@mail.cor.epa.gov> on Mon, 05 Apr 1999
16:47:29 -0700, David L. Cassell <cassell@mail.cor.epa.gov> says...
> Larry Rosler wrote:
...
> > If Perl were an acronym, it would be spelled with all caps. (I know
> > that some acronyms, such as BASIC and COBOL, existed; but as they have
> > become more widely known, they have downcased into normal usage to
> > divert attention from the acronymic origins. Unix was spelled UNIX for
> > trademark purposes, but was never an acronym.)
>
> Oooh! I get to disagree with Larry! :-)
> According to my dictionary, acronym is: 'a word (such as radar or snafu)
> formed from the initial letter or letters of each of the successive parts
> or major parts of a compound term'. No requirement for capitalization.
Right.
> APL is not an acronym because it is not a pronounceable word.
Tell that to Eve, or to William Tell, or to Sir Isaac Newton, or even to
Steve Jobs. :-)
> SNOBOL is.
> I almost said QED here, but that might start another sub-thread. :-)
However, I do see the point more clearly now. An acronym is a
pronounceable word abbreviated from initial snippets of a compound term.
And either Perl is an acronym or the quoted phrases are 'retro-acronyms'
(my own coinage -- does a neologism for exist already?). But the
original chicken-egg question seems to lean toward the latter (according
to the Blue Camel snippet that I quoted).
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 05 Apr 1999 18:16:37 -0500
From: Kent Perrier <kperrier@blkbox.com>
Subject: Re: PROGRESS Data Base and Perl ?
Message-Id: <ysi3e2emze2.fsf@blkbox.com>
"Patrick Fichou" <fichou@club-internet.fr> writes:
> I currently work on a Unix/Progress environment and discovered Perl
> recently... but really like this language !!!
> I would like to know if someone knows how to acces a Progress DB with Perl.
> Just reading the files would be enough to make some CGI package !
> I use HP/UX 10.20 and Progress 6.3.
> Thank you !
You should look at the DBI modules.
Kent
------------------------------
Date: 5 Apr 1999 23:52:40 GMT
From: immot5@aol.com (Immot5)
Subject: Rand to Whole Number
Message-Id: <19990405195240.06482.00002926@ng152.aol.com>
Excuse my ignorance, but is there anyway I can make the result of rand be a
whole number between 1 and 1000?
Thanx,
Tom
------------------------------
Date: 6 Apr 1999 00:25:54 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Rand to Whole Number
Message-Id: <slrn7gil4i.k36.sholden@pgrad.cs.usyd.edu.au>
On 5 Apr 1999 23:52:40 GMT, Immot5 <immot5@aol.com> wrote:
>Excuse my ignorance, but is there anyway I can make the result of rand be a
>whole number between 1 and 1000?
If you has a number between 0 and 1000 _and_ you knew (from perldoc -f rand)
that it was actualy >=0 and <1000, and you wanted a number between 1 and 1000
what would you do?
Hint : you could add 1 and then only use the integer portion, or the other
way around...
--
Sam
Perl was designed to be a mess (though in the nicest of possible ways).
--Larry Wall
------------------------------
Date: Mon, 5 Apr 1999 15:55:55 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: This proverbial "perldoc".
Message-Id: <MPG.1172df54fbc6053b98983b@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <7ebdfo$gck@news.service.uci.edu> on Mon, 5 Apr 1999 15:32:36
-0700, Gabriel Richards <grichard@uci.edu> says...
...
> No such luck. I've scoured my win32 box and there doesn't exist any file
> named perldoc.
Maybe you should upgrade your perl installation. Mine is ActivePerl
5.005_02 build 509, and there is a file D:\perl\bin\perldoc.bat .
--
Larry Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 6 Apr 1999 00:48:28 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: This proverbial "perldoc".
Message-Id: <7eblks$s1e$2@client2.news.psi.net>
Bob Trieger (sowmaster@juicepigs.com) wrote on MMXLIII September MCMXCIII
in <URL:news:7ebb64$l0e$1@fir.prod.itd.earthlink.net>:
:: "Gabriel Richards" <grichard@uci.edu> wrote:
:: oo- try:
:: oo-
:: oo- perldoc perldoc
:: oo-
:: oo- No dice...another idea? Where is perldoc!
::
:: Where are you typing perldoc?
::
:: If on your Win32 machine, cd to the c:\perl\bin directory and try it there.
::
:: On you *nix machine, type "which perl" go to the directory it gives you and
:: try it there.
So, this should work?
`which perl`doc `which perl`doc
:: It is most likely there but the directory it resides in is not in your path.
If it isn't in your path, and perl resides in the same directory, you
aren't likely to run perl either..... Of course, if it isn't in your
path, which won't find it....
Abigail
--
sub f{sprintf'%c%s',$_[0],$_[1]}print f(74,f(117,f(115,f(116,f(32,f(97,
f(110,f(111,f(116,f(104,f(0x65,f(114,f(32,f(80,f(101,f(114,f(0x6c,f(32,
f(0x48,f(97,f(99,f(107,f(101,f(114,f(10,q ff)))))))))))))))))))))))))
------------------------------
Date: Mon, 05 Apr 1999 19:42:07 -0400
From: brian@pm.org (brian d foy)
Subject: Re: Using Perl For ErrorDocuments
Message-Id: <brian-ya02408000R0504991942070001@news.panix.com>
In article <37090194.11674826@news.iaw.on.ca>, hutcheon@iaw.on.ca posted:
> Simulated Error: works fine
> Real Error: 404 screen with 500 on the errordocument
what does that mean? for 404's you should return 404. otherwise
indexers, validators, and all sorts of other automata will have
problems with your site. (i know of at least one server product that
returns 200 although the message body has the "File Not Found" text for
not found files. it causes lots of grief).
> Is there anything special needed for responding to the error? HTML
> headders, etc?
not really.
> Can I use a 1; at the end of the file? will this effect the run?
it shouldn't, but why would you?
> Can Full Query Strings be used in the .htaccess? ie:
depends on the server. try it to find out. ;)
--
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, 05 Apr 1999 23:49:33 GMT
From: garthwebb@my-dejanews.com
Subject: XMODEM Protocol From Perl
Message-Id: <7ebi6b$lo6$1@nnrp1.dejanews.com>
I just installed the Win32::SerialPort package with the intention of using it
to connect to my modem and automate a download process. The problem is that
the data I am receiving comes as XMODEM. I've done a search on CPAN and
DejaNews for XMODEM and I couldn't find any package to interpret this or
message concerning this issue. Does anyone know/have of some Perl code that
will receive XMODEM data from a serial port? I've found some C source that
does it but its horrible lengthy non-procedural code. Before I start
converting it to Perl I'd like to know if anyone has done this already. If
anyone knows where a description of the XMODEM protocol can be found (one
that I can code fresh from), that would help as well.
Thanks,
Garth
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
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 5305
**************************************