[13673] in Perl-Users-Digest
Perl-Users Digest, Issue: 1083 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 15 16:23:11 1999
Date: Fri, 15 Oct 1999 13:22:39 -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: <940018959-v9-i1083@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 15 Oct 1999 Volume: 9 Number: 1083
Today's topics:
Re: What is THE book for PERL? <jjyooi@dcs.qmw.ac.uk>
Re: What is THE book for PERL? bwb@acm.org
Re: What is THE book for PERL? <jon@midnightbeach.com>
Re: What is THE book for PERL? <marcel.grunauer@lovely.net>
Re: What is THE book for PERL? <cassell@mail.cor.epa.gov>
Re: What is THE book for PERL? <jjyooi@dcs.qmw.ac.uk>
Re: What is THE book for PERL? (Larry Rosler)
Re: What is THE book for PERL? (Tad McClellan)
Re: What is THE book for PERL? (Scott McMahan)
Re: What is THE book for PERL? <qumsieh@sympatico.ca>
Re: What is THE book for PERL? (Brett W. McCoy)
Re: What is THE book for PERL? (Andrew Johnson)
Re: What is THE book for PERL? <aqumsieh@matrox.com>
Re: What is THE book for PERL? (Brett W. McCoy)
What is the difference between signed and unsigned char <tintagel@cowboy.net>
Re: What is the difference between signed and unsigned (Anno Siegel)
Re: Where to find Perl scripts? <@mdo.net>
Re: Where to find Perl scripts? <srice@rtcnet.com>
Re: Where to find Perl scripts? <sjs@yorku.ca>
Re: Where to find Perl scripts? <gellyfish@gellyfish.com>
Re: Where to find Perl scripts? <carvdawg@patriot.net>
Re: Where to find Perl scripts? <sariq@texas.net>
Re: Where to find Perl scripts? <sariq@texas.net>
Re: Where to find Perl scripts? (Brett W. McCoy)
Re: Where to find Perl scripts? <gellyfish@gellyfish.com>
Re: Where to find Perl scripts? (Brett W. McCoy)
Re: Where to find Perl scripts? <sariq@texas.net>
Re: Where to find Perl scripts? <ilya@speakeasy.org>
Re: while(loop) question.. (T. Yamada)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 13 Oct 1999 08:20:38 +0100
From: Johnny 'Loopy' Ooi <jjyooi@dcs.qmw.ac.uk>
Subject: Re: What is THE book for PERL?
Message-Id: <380432C6.C3A58C99@dcs.qmw.ac.uk>
Tad McClellan wrote:
>
> Johnny 'Loopy' Ooi (jjyooi@dcs.qmw.ac.uk) wrote:
>
> Do you know how to _program_ already?
Unless you count using BASIC as programming...
>
> : so I need
> : something that is for a (near) complete beginner.
>
> If so, then "Learning Perl" (llama or gecko) is the way to go.
Yes. I've heard that was good. I'll think I check that one out. Thanks
for the advice.
--
Johnny Ooi. Aliases: Loopy, Tuxedo Mask, Quote Master.....
E-Mail : jjyooi@dcs.qmw.ac.uk or jjyooi@yahoo.com
WWW : http://www.dcs.qmw.ac.uk/~jjyooi/
ICQ No : 6155774
"Stay sane guys!"
===============================================================
------------------------------
Date: Wed, 13 Oct 1999 15:05:33 GMT
From: bwb@acm.org
Subject: Re: What is THE book for PERL?
Message-Id: <7u273g$q7v$1@nnrp1.deja.com>
In article <37FD9728.257BC43@dcs.qmw.ac.uk>,
Johnny 'Loopy' Ooi <jjyooi@dcs.qmw.ac.uk> wrote:
> Can anyone in the know tell me the _best_ book to read/buy for
research
> and reference into PERL?
Flat Hill Books has a good set of Perl book reviews and recommendations:
http://www.flathill.com/languages/perl/
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 13 Oct 1999 13:53:29 -0700
From: Jon Shemitz <jon@midnightbeach.com>
Subject: Re: What is THE book for PERL?
Message-Id: <3804F149.57353CE4@midnightbeach.com>
Johnny 'Loopy' Ooi wrote:
> Can anyone in the know tell me the _best_ book to read/buy for research
> and reference into PERL?
I bought Programming Perl (the 'camel book') last week, and have been
having an ... interesting time with it. The authors aren't afraid to use
a construct before they've even mentioned it, let alone described how it
works, and at least some of the (mostly uncommented) examples are
distinctly non-trivial. It's very dense, with a single sentence often
expressing something that I'd spend a whole pp on, were I writing it for
a programmer's magazine. It's not quite as slow going as some of the
page-an-hour philosophy texts I read in college, but it's probably the
closest I've come to that in the nearly twenty years since then.
Definite perceptual bi-stability: It flickers between loads of fun and
intensely frustrating.
It's not for the impatient or the novice programmer, but it (and the
three progressively more ambitious scripts I've done) have done a fine
job of taking me from 'this looks like a two year old's typing' to 'gee,
this is great, but I'll NEVER be able to read anyone else's scripts' and
now to 'I like Perl'. (Otoh, the book makes the Perl community seem a
lot nicer than this newsgroup does: I've never seen a comp.lang group
act so nasty to newbies.)
I still wonder, though: How do the examples (and the code in the std
distribution) compare to 'Perl in the field'? I'd like to imagine that
if I can understand the examples in the camel book I'll be able read any
Perl script I might run into, but maybe I'm fooling myself?
--
http://www.midnightbeach.com - Me, my work, my writing, and
http://www.midnightbeach.com/hs - my homeschool resource pages
------------------------------
Date: Wed, 13 Oct 1999 21:23:13 GMT
From: Marcel Grunauer <marcel.grunauer@lovely.net>
Subject: Re: What is THE book for PERL?
Message-Id: <0AQFOOJu8dNzug7rSRwBTHB455MF@4ax.com>
On Wed, 13 Oct 1999 13:53:29 -0700, Jon Shemitz
<jon@midnightbeach.com> wrote:
> I bought Programming Perl (the 'camel book') last week, and have been
> having an ... interesting time with it.
Not too ... interesting, I hope :-)
> The authors aren't afraid to use
> a construct before they've even mentioned it, let alone described how it
> works, and at least some of the (mostly uncommented) examples are
> distinctly non-trivial.
Only in the first few pages, where you'll find a broad overview of the
language with practical examples. Later chapter explain the concepts
thoroughly, albeit concisely.
> It's very dense, with a single sentence often
> expressing something that I'd spend a whole pp on, were I writing it for
> a programmer's magazine.
Much like Perl itself, methinks.
> I still wonder, though: How do the examples (and the code in the std
> distribution) compare to 'Perl in the field'? I'd like to imagine that
> if I can understand the examples in the camel book I'll be able read any
> Perl script I might run into[...]
Not if they are Abigailisms.
--
Marcel, Perl Padawan
sub AUTOLOAD{$_=$AUTOLOAD;s;.*::;;;y;_; ;;print}&Just_Another_Perl_Hacker;
------------------------------
Date: Wed, 13 Oct 1999 15:21:04 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: What is THE book for PERL?
Message-Id: <380505D0.C6731E11@mail.cor.epa.gov>
Jon Shemitz wrote:
[snip]
> I still wonder, though: How do the examples (and the code in the std
> distribution) compare to 'Perl in the field'? I'd like to imagine that
> if I can understand the examples in the camel book I'll be able read any
> Perl script I might run into, but maybe I'm fooling myself?
Well, if you can read and understand the code in the Camel,
then when you look at the code loose on websites around the world,
you'll not only be able to read it, but you'll also know exactly
when to read for the air sickness bag.
And then you'll begin to understand why certain questions get
the abrasive treatment ofttimes seen around here. For real
fun, wait until 1/1/2000 when thousands of script-kiddies find
out that their borrowed webcode doesn't handle dates right.
This place will be the text version of a Hieronymus Bosch
painting.
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Thu, 14 Oct 1999 09:32:08 +0100
From: Johnny 'Loopy' Ooi <jjyooi@dcs.qmw.ac.uk>
Subject: Re: What is THE book for PERL?
Message-Id: <38059508.6D4DDA29@dcs.qmw.ac.uk>
Jon Shemitz wrote:
{A lot of stuff snipped out)
I'm still thinking about that...
--
Johnny Ooi. Aliases: Loopy, Tuxedo Mask, Quote Master.....
E-Mail : jjyooi@dcs.qmw.ac.uk or jjyooi@yahoo.com
WWW : http://www.dcs.qmw.ac.uk/~jjyooi/
ICQ No : 6155774
"Stay sane guys!"
===============================================================
------------------------------
Date: Wed, 13 Oct 1999 15:33:19 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: What is THE book for PERL?
Message-Id: <MPG.126ea888c40d2ff998a08d@nntp.hpl.hp.com>
In article <380505D0.C6731E11@mail.cor.epa.gov> on Wed, 13 Oct 1999
15:21:04 -0700, David Cassell <cassell@mail.cor.epa.gov> says...
...
> ... For real
> fun, wait until 1/1/2000 when thousands of script-kiddies find
> out that their borrowed webcode doesn't handle dates right.
Did you mean 1/1/19100 or 1/1/100?
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 14 Oct 1999 04:58:51 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: What is THE book for PERL?
Message-Id: <b064u7.tp2.ln@magna.metronet.com>
Jon Shemitz (jon@midnightbeach.com) wrote:
: I've never seen a comp.lang group
: act so nasty to newbies.)
This unqualified use of the term "newbie" is misleading, and
a disservice to the Perl community.
[ everybody does this, I'm not picking on you in particular, it's
just that you have provided me an opportunity to mention it.
]
I encourage all posters here to begin saying _what kind_
of newbie they mean when they use the term.
Newbie to _what_?
Newbies to Perl are not (or shouldn't anyway) the recipients
of nastiness.
Newbies to Usenet, however, get a dose of *return* nastiness
when they ignore Usenet's SOP ( 'netiquette ).
It is unfortunate that Newbies to Perl are often also Newbies
to Usenet, leading Newbies of either type to think that Newbies
to Perl get their shit jumped in.
Anybody who has advanced beyond Usenet kindergarten should be
able to get a civil response here.
It is just that this newsgroup gets boatloads more pre-K
Usenauts than other technical newsgroups.
The rampant nastiness here is a symptom of the problem, not
the cause of the problem.
The cause of the problem is clueless posters who don't do
even a rudimentary attempt at finding the answers in the
files already installed on their hard drive before posting.
Whoever has given them Usenet access without also pointing out
that they should monitor news.announce.newusers
(Usenet kindergarten) before posting are the real culprits.
But nobody seems to get mad at _them_ ...
------------------------------------------------
In article <1995Nov9.193745.13694@netlabs.com>, lwall@netlabs.com (Larry
Wall) wrote: ...
<Larry> [snip] I view a programming language as a place to be
<Larry> explored, like Disneyland. You don't need to have a lot of preparation
<Larry> to explore a theme park. You do have to go along with the crowd
<Larry> control measures, though. In a sense, each ride has its own
<Larry> prerequisites--if you cut in line, you risk getting tossed out of the
<Larry> park.
<Larry>
<Larry> What we have here in this newsgroup is a failure in crowd control.
<Larry> Reading the FAQ is like staying in line--it's something you should
<Larry> learn in kindergarten. Usenet needs a better kindergarten.
------------------------------------------------
Usenet _has_ an adequate kindergarten, it's just that ISPs
automatically advance their lusers to the first grade.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 14 Oct 1999 17:28:09 GMT
From: scott@aravis.softbase.com (Scott McMahan)
Subject: Re: What is THE book for PERL?
Message-Id: <JooN3.680$SS3.49829@newshog.newsread.com>
Johnny 'Loopy' Ooi (jjyooi@dcs.qmw.ac.uk) wrote:
> Can anyone in the know tell me the _best_ book to read/buy for research
> and reference into PERL?
It used to be Programming Perl, but Perl is so BIG now that you can't
do it in one book anymore. It just depends on where you are and what
you're doing.
I have some recommendations of what I use myself at the URL below.
If you're going to buy one anyway, do it through my web site :) (I get
lots of clicks, but no one buys anything. :))
Scott
http://autoperl.skwc.com Automating Windows With Perl
------------------------------
Date: Fri, 15 Oct 1999 02:17:34 GMT
From: Ala Qumsieh <qumsieh@sympatico.ca>
Subject: Re: What is THE book for PERL?
Message-Id: <38068F41.41939854@sympatico.ca>
Johnny 'Loopy' Ooi wrote:
>
> Tad McClellan wrote:
> >
> > Johnny 'Loopy' Ooi (jjyooi@dcs.qmw.ac.uk) wrote:
> >
> > Do you know how to _program_ already?
>
> Unless you count using BASIC as programming...
Why not? Perl borrowed some things from BASIC.
--Ala
------------------------------
Date: Fri, 15 Oct 1999 02:20:11 GMT
From: bmccoy@foiservices.com (Brett W. McCoy)
Subject: Re: What is THE book for PERL?
Message-Id: <slrn80d42s.3jt.bmccoy@moebius.foiservices.com>
Also Sprach Ala Qumsieh <qumsieh@sympatico.ca>:
>> Tad McClellan wrote:
>> >
>> > Johnny 'Loopy' Ooi (jjyooi@dcs.qmw.ac.uk) wrote:
>> >
>> > Do you know how to _program_ already?
>>
>> Unless you count using BASIC as programming...
>
>Why not? Perl borrowed some things from BASIC.
And what would those things be?
--
Brett W. McCoy bmccoy@foiservices.com
Computer Operations Manager (Alpha Geek) http://www.foiservices.com
FOI Services, Inc./DIOGENES 301-975-0110
---------------------------------------------------------------------------
------------------------------
Date: Fri, 15 Oct 1999 03:21:36 GMT
From: andrew-johnson@home.com (Andrew Johnson)
Subject: Re: What is THE book for PERL?
Message-Id: <45xN3.107$q82.9908@news1.rdc1.mb.home.com>
In article <slrn80d42s.3jt.bmccoy@moebius.foiservices.com>,
Brett W. McCoy <bmccoy@foiservices.com> wrote:
! Also Sprach Ala Qumsieh <qumsieh@sympatico.ca>:
!
! >> Tad McClellan wrote:
[snip]
! >
! >Why not? Perl borrowed some things from BASIC.
!
! And what would those things be?
well, according to a footnote on page 600 of the blue camel,
statement modifiers and maybe formats were borrowed from BASIC/PLUS.
andrew
--
Andrew L. Johnson http://www.manning.com/Johnson/
They're not soaking, they're rusting!
-- my wife on my dishwashing habits
------------------------------
Date: Fri, 15 Oct 1999 10:16:34 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: What is THE book for PERL?
Message-Id: <x3y90547lq6.fsf@tigre.matrox.com>
bmccoy@foiservices.com (Brett W. McCoy) writes:
> Also Sprach Ala Qumsieh <qumsieh@sympatico.ca>:
> >
> >Why not? Perl borrowed some things from BASIC.
>
> And what would those things be?
I am not exaclty sure, but formats are among them. There was a thread
last year (initiated by Larry Rosler, I believe ... or was it Uri
Guttman?? hmm.. ) that discussed which languages influenced Perl and
how.
Check the archives if you're interested.
--Ala
------------------------------
Date: Fri, 15 Oct 1999 15:39:53 GMT
From: bmccoy@foiservices.com (Brett W. McCoy)
Subject: Re: What is THE book for PERL?
Message-Id: <slrn80eiuc.645.bmccoy@moebius.foiservices.com>
Also Sprach Ala Qumsieh <aqumsieh@matrox.com>:
>> >Why not? Perl borrowed some things from BASIC.
>>
>> And what would those things be?
>
>I am not exaclty sure, but formats are among them. There was a thread
>last year (initiated by Larry Rosler, I believe ... or was it Uri
>Guttman?? hmm.. ) that discussed which languages influenced Perl and
>how.
Yeah, sorta... formats seem vaguely like the PRINT USING command (which is
vaguely like the C printf() function as well) and they're a little
FORTRANish as well (from which BASIC borrowed heavily).
--
Brett W. McCoy bmccoy@foiservices.com
Computer Operations Manager (Alpha Geek) http://www.foiservices.com
FOI Services, Inc./DIOGENES 301-975-0110
---------------------------------------------------------------------------
------------------------------
Date: Tue, 12 Oct 1999 14:04:56 -0500
From: "Jasmine" <tintagel@cowboy.net>
Subject: What is the difference between signed and unsigned characters?
Message-Id: <7u008d$cvm$1@news.cowboy.net>
Hello,
I'm trying to understand the difference between signed and unsigned
characters. I've researched every place I can think of, including the
perldocs, the O'Reilly books, etc., but this answer is as elusive as the
Golden Fleece.
I'm hoping to better understand the difference between pack("C",1,2,3) and
pack("c",1,2,3). Every text says the difference is that C is unsigned and c
is signed, but doesn't explain the difference between signed and unsigned.
Any information, or links to the answer would be greatly appreciated.
Thanks,
Jasmine
------------------------------
Date: 13 Oct 1999 13:31:28 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: What is the difference between signed and unsigned characters?
Message-Id: <7u21jg$aro$1@lublin.zrz.tu-berlin.de>
Jasmine <djazz69@hotmail.com> wrote in comp.lang.perl.misc:
>Hello,
>
>I'm trying to understand the difference between signed and unsigned
>characters. I've researched every place I can think of, including the
>perldocs, the O'Reilly books, etc., but this answer is as elusive as the
>Golden Fleece.
>
>I'm hoping to better understand the difference between pack("C",1,2,3) and
>pack("c",1,2,3). Every text says the difference is that C is unsigned and c
>is signed, but doesn't explain the difference between signed and unsigned.
>
>Any information, or links to the answer would be greatly appreciated.
The difference isn't visible in pack, only in unpack:
$c = unpack 'c', chr 255; $C = unpack 'C', chr 255;
are the same as
$c = -1; $C = 255;
Well, and so on...
Anno
------------------------------
Date: Tue, 12 Oct 1999 16:34:07 -0400
From: "CS" <@mdo.net>
Subject: Re: Where to find Perl scripts?
Message-Id: <qUMM3.10901$UG5.630073@typ11.nn.bcandid.com>
Or, best for the money is O'Reily's Perl CD Bookshelf - six books in one,
with a search facility over all six books, and for the price of 2 books
(about 50 - 60 dollars).
------------------------------
Date: Tue, 12 Oct 1999 21:24:49 GMT
From: Stephanie <srice@rtcnet.com>
Subject: Re: Where to find Perl scripts?
Message-Id: <7u08uh$eag$1@nnrp1.deja.com>
Actually, if you just do a web search using "script" you'll come up
with dozens of sites with free perl scripts. Best of luck in your
search.
In article <_ELM3.9217$Pf4.55133@news.rdc2.mi.home.com>,
"Ryan Michaels" <RyanM019@rem0veThis.home.com> wrote:
> I'm learning Perl, and the best way I learn any programming language
is by
> looking at code that's already written and figuring it out. Are there
any
> websites that have bundles of free Perl scripts?
>
> They can be as simple as 'print "hello world";'.. it doesn't matter.
I just
> need something to learn from.
>
> Thanks in advance.
>
>
--
Stephanie Rice
Information Services
Roseville Communications
srice@rtcnet.com
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 12 Oct 1999 19:34:38 -0500
From: Steven Smolinski <sjs@yorku.ca>
Subject: Re: Where to find Perl scripts?
Message-Id: <m3vh8ct7xd.fsf@hank.yorku.ca>
"Ryan Michaels" <RyanM019@rem0veThis.home.com> writes:
> I'm learning Perl, and the best way I learn any programming language is by
> looking at code that's already written and figuring it out. Are there any
> websites that have bundles of free Perl scripts?
One of the best puts up code (from his WebTechniques columns) at
www.stonehenge.com/merlyn.
Steve
------------------------------
Date: 13 Oct 1999 09:20:58 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Where to find Perl scripts?
Message-Id: <380440ea_1@newsread3.dircon.co.uk>
Ryan Michaels <RyanM019@rem0veThis.home.com> wrote:
> I'm learning Perl, and the best way I learn any programming language is by
> looking at code that's already written and figuring it out. Are there any
> websites that have bundles of free Perl scripts?
>
I would start by searching through this group in Deja news. The advantage of
this is that code presented will be subject to the criticism of other
denizens of the group unlike arbitrary code found on the web - the experienced
know which sources they can trust but you are less likely to be able to
make the distinction when starting out. Many of the regular contributors
to the group will also have example code on the web someplace.
/J\
--
"Most big companies don't like you very much, except hotels, airlines
and Microsoft, which don't like you at all" - Bill Bryson
------------------------------
Date: Wed, 13 Oct 1999 05:56:07 -0400
From: "Harlan Carvey, CISSP" <carvdawg@patriot.net>
Subject: Re: Where to find Perl scripts?
Message-Id: <38045737.1FC83FC@patriot.net>
> I'm learning Perl, and the best way I learn any programming language is by
> looking at code that's already written and figuring it out. Are there any
> websites that have bundles of free Perl scripts?
>
> They can be as simple as 'print "hello world";'.. it doesn't matter. I just
> need something to learn from.
Okay, let's see...go to the O'Reilly site and look for Perl books. Also look
in
the NT stuff...a couple of the books, most notably the "Essential NT SysAdmin",
have examples in Perl. The zipped archive of the examples are available.
Dave Roth's site...http://www.roth.net. There are examples available from his
book.
My site...http://patriot.net/~carvdawg/perl.html.
http://cwashington.netreach.net
www.15seconds.com
------------------------------
Date: Wed, 13 Oct 1999 08:59:27 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: Where to find Perl scripts?
Message-Id: <3804903F.B57677A0@texas.net>
Ryan Michaels wrote:
>
> I'm learning Perl, and the best way I learn any programming language is by
> looking at code that's already written and figuring it out. Are there any
> websites that have bundles of free Perl scripts?
Others have pointed out that looking at random scripts you find via the
web is dangerous. You should heed their advice.
However, there's a lot of well-written Perl code on your hardrive! Just
go to your lib/perl directory (wherever that might be in your case), and
look around. If a module does a thing that I need to do, I'm often
curious enough to look at the module's source to see how it does it.
You can also get code from CPAN that does something in which you're
interested. Just make sure that the module is written in Perl, of
course. :)
- Tom
------------------------------
Date: Wed, 13 Oct 1999 09:22:05 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: Where to find Perl scripts?
Message-Id: <3804958D.E91603E0@texas.net>
"Harlan Carvey, CISSP" wrote:
>
> > I'm learning Perl, and the best way I learn any programming language is by
> > looking at code that's already written and figuring it out. Are there any
> > websites that have bundles of free Perl scripts?
> >
> Okay, let's see...go to the O'Reilly site and look for Perl books.
Good advice there.
> Also look
> in
> the NT stuff...a couple of the books, most notably the >"Essential NT SysAdmin",
> have examples in Perl. The zipped archive of the examples are available.
I don't use NT, so can't comment here.
> My site...http://patriot.net/~carvdawg/perl.html.
I have a bit of a quibble with this, even if it's given in kindness, and
not just in self-promotion.
I'm not a Perl expert, but I immediately noticed a few things in about
three minutes of scanning the code:
1) Nary a '-w' seen.
2) Nor a 'use strict;'.
3) 'die' calls without providing the error messages.
4) *Very* little error checking.
5) C-style for loops without a good reason.
Now Harlan might be the nicest guy in the world, and just trying to help
out. But, as others have said, beware of code floating around in
cyberspace.
> http://cwashington.netreach.net
This site hurt my eyes too much to wade through.
> www.15seconds.com
I didn't see any Perl here, but I didn't look very hard.
At least the infamous MW scripts weren't on the list... :)
- Tom
------------------------------
Date: Wed, 13 Oct 1999 14:38:01 GMT
From: bmccoy@foiservices.com (Brett W. McCoy)
Subject: Re: Where to find Perl scripts?
Message-Id: <slrn8096i8.su9.bmccoy@moebius.foiservices.com>
Also Sprach Tom Briles <sariq@texas.net>:
>1) Nary a '-w' seen.
>2) Nor a 'use strict;'.
>3) 'die' calls without providing the error messages.
>4) *Very* little error checking.
>5) C-style for loops without a good reason.
1-4 are good advice all around. I don't understand 5, though. Is using
the C-style of a for loop considered bad style in Perl programming? Not a
criticism, just curious (having been a C programmer for many years before
migrating to Perl). I wouldn't use the C-style for looping through a
list, of course -- is this what you mean?
--
Brett W. McCoy bmccoy@foiservices.com
Computer Operations Manager (Alpha Geek) http://www.foiservices.com
FOI Services, Inc./DIOGENES 301-975-0110
---------------------------------------------------------------------------
------------------------------
Date: 13 Oct 1999 16:03:42 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Where to find Perl scripts?
Message-Id: <38049f4e_1@newsread3.dircon.co.uk>
Brett W. McCoy <bmccoy@foiservices.com> wrote:
> Also Sprach Tom Briles <sariq@texas.net>:
>
>>1) Nary a '-w' seen.
>>2) Nor a 'use strict;'.
>>3) 'die' calls without providing the error messages.
>>4) *Very* little error checking.
>>5) C-style for loops without a good reason.
>
> 1-4 are good advice all around. I don't understand 5, though. Is using
> the C-style of a for loop considered bad style in Perl programming? Not a
> criticism, just curious (having been a C programmer for many years before
> migrating to Perl). I wouldn't use the C-style for looping through a
> list, of course -- is this what you mean?
>
Er yes. Often you see :
for($i = 0; $i <= 10 ; $i++ )
{
....
}
rather than:
for $i ( 0 ... 10 )
{
}
It is of course infinitely worse if there is an array involved IMHO ...
/J\
--
"What is the future for beef? Curtains?" - Graham Norton
------------------------------
Date: Wed, 13 Oct 1999 15:14:07 GMT
From: bmccoy@foiservices.com (Brett W. McCoy)
Subject: Re: Where to find Perl scripts?
Message-Id: <slrn8098lu.su9.bmccoy@moebius.foiservices.com>
Also Sprach Jonathan Stowe <gellyfish@gellyfish.com>:
>Er yes. Often you see :
>
> for($i = 0; $i <= 10 ; $i++ )
> {
> ....
> }
>
>rather than:
>
> for $i ( 0 ... 10 )
> {
>
> }
Yeah... if you're not using $x for anything, it's completely superfluous.
--
Brett W. McCoy bmccoy@foiservices.com
Computer Operations Manager (Alpha Geek) http://www.foiservices.com
FOI Services, Inc./DIOGENES 301-975-0110
---------------------------------------------------------------------------
------------------------------
Date: Wed, 13 Oct 1999 10:27:12 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: Where to find Perl scripts?
Message-Id: <3804A4D0.8D59BCBB@texas.net>
"Brett W. McCoy" wrote:
>
> Also Sprach Tom Briles <sariq@texas.net>:
>
> >1) Nary a '-w' seen.
> >2) Nor a 'use strict;'.
> >3) 'die' calls without providing the error messages.
> >4) *Very* little error checking.
> >5) C-style for loops without a good reason.
>
> 1-4 are good advice all around. I don't understand 5, though. Is using
> the C-style of a for loop considered bad style in Perl programming? Not a
> criticism, just curious (having been a C programmer for many years before
> migrating to Perl). I wouldn't use the C-style for looping through a
> list, of course -- is this what you mean?
>
Partially. Do you mean 'array', and not 'list'?
From perldoc perlsyn:
"Here's how a C programmer might code up a particular
algorithm in Perl:
for (my $i = 0; $i < @ary1; $i++) {
for (my $j = 0; $j < @ary2; $j++) {
if ($ary1[$i] > $ary2[$j]) {
last; # can't go to outer :-(
}
$ary1[$i] += $ary2[$j];
}
# this is where that last takes me
}
"Whereas here's how a Perl programmer more comfortable with
the idiom might do it:
OUTER: foreach my $wid (@ary1) {
INNER: foreach my $jet (@ary2) {
next OUTER if $wid > $jet;
$wid += $jet;
}
}
"See how much easier this is? It's cleaner, safer, and
faster. It's cleaner because it's less noisy. It's safer
because if code gets added between the inner and outer
loops later on, the new code won't be accidentally
executed. The next explicitly iterates the other loop
rather than merely terminating the inner one. And it's
faster because Perl executes a foreach statement more
rapidly than it would the equivalent for loop."
- Tom
------------------------------
Date: Wed, 13 Oct 1999 17:39:12 GMT
From: Ilya <ilya@speakeasy.org>
Subject: Re: Where to find Perl scripts?
Message-Id: <s09gu0gbbhk56@corp.supernews.com>
David Amann <dove@synopsys.com> wrote:
> Hi Ryan,
> Ryan Michaels wrote:
>> I'm learning Perl, and the best way I learn any programming language is by
>> looking at code that's already written and figuring it out. Are there any
>> websites that have bundles of free Perl scripts?
>>
>> They can be as simple as 'print "hello world";'.. it doesn't matter. I just
>> need something to learn from.
> If you have a few bucks to spend, I would recommend buying the Perl Cookbook by
> Tom Christiansen and Nathan Torkington. It's chock full of examples that you
> can use over and over again. And it's organized in an easy-to-reference way.
> I use it constantly.
I agree, it is one of the most useful books one can get, especially for
advanced users.
===========================================================================
Money, when considered as the fruit of many years' industry, as the reward
of labor, sweat and toil, is not to be sported with, or trusted to the airy
bubble of paper currency. -- Thomas Paine
===========================================================================
------------------------------
Date: 14 Oct 1999 02:09:45 +0900
From: tai@imasy.or.jp (T. Yamada)
Subject: Re: while(loop) question..
Message-Id: <87d7ujyyp2.fsf@imasy.or.jp>
>>>>> "Alex" == Alex Menendez <amen@hotbacon.com> writes:
Alex> while (($name, $phone) = $sth->fetchrow_array) {
Alex> print "$name: $phone\n";
Alex> }
Alex> Although I am returning an undef list (I have tried to just
Alex> explicitly return undef as well!), my while loop gets stuck in
Alex> an infinite loop after the first results set.
Try
perl -e 'while (@a = undef) { print "loop\n"; }'
and
perl -e 'while ($a = undef) { print "loop\n"; }'
See the difference? Assigning undef to array does not result
in false statement (because it'll be handle as an array with
one element in it, which is undef).
Use empty array instead of undef.
--
T. Yamada <tai@imasy.or.jp>
PGP fingerprint = 6B 57 1B ED 65 4C 7D AE 57 1B 49 A7 F7 C8 23 46
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 1083
**************************************