[13070] in Perl-Users-Digest
Perl-Users Digest, Issue: 480 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 12 11:17:14 1999
Date: Thu, 12 Aug 1999 08:10:17 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 12 Aug 1999 Volume: 9 Number: 480
Today's topics:
Re: Looking for a good Perl Book <elaine@chaos.wustl.edu>
Re: Looking for a good Perl Book <elaine@chaos.wustl.edu>
Re: Looking for a good Perl Book <elaine@chaos.wustl.edu>
Re: Looking for a good Perl Book (Abigail)
Re: Looking for a good Perl Book (Abigail)
Re: Newbie? => Merging 2 files to a third file (David Alan Black)
Re: NO-ONE USES PERLQT ! Godwin does! <keithmur@mindspring.com>
Re: NO-ONE USES PERLQT !!!!!!!!!!!!!!!!!!!!!??????????? (Marcel Grunauer)
p5p flamage (was Re: reference to object method) (Greg Bacon)
Re: Parse::RecDescent, optional subrules, and errors (Rand Bamberg)
Passing named and unnamed parameters to subs f00baz@my-deja.com
Re: Passing named and unnamed parameters to subs (Benjamin Franz)
Re: Perl is eating up my memory <elaine@chaos.wustl.edu>
Re: perl won't complie with Berkeley DB <systems@imag.net>
Read/Retrieve Romote html document? <pmt@top.mitre.org>
Re: Read/Retrieve Romote html document? <jeffp@crusoe.net>
Re: Read/Retrieve Romote html document? <stirling@banet.net>
Re: Run a script from a web browser and put it in the b <shalabh@pspl.co.in>
Re: s/// and interpolation (Steve Linberg)
Re: s/// and interpolation (Steve Linberg)
Re: Sesssion ID (Greg Bacon)
Re: Testing (Please disregard) (Greg Bacon)
User Agent & SSL <william.klint@daytonoh.ncr.com>
Re: while loop teminates too early (Bart Lateur)
Re: Why ? (I R A Darth Aggie)
Re: Why ? (Larry Rosler)
Re: Why use Perl when we've got Python?! (Bart Lateur)
Re: Why use Perl when we've got Python?! (I R A Darth Aggie)
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 12 Aug 1999 09:49:42 -0400
From: Elaine -HFB- Ashton <elaine@chaos.wustl.edu>
Subject: Re: Looking for a good Perl Book
Message-Id: <37B2D082.9DB03D5C@chaos.wustl.edu>
Abigail wrote:
> ;; abigail++ :) Marry me darling.
>
> Sure. How about Friday, Aug 20, around 3ish?
>
> You'd think Kernighan would like to be the best man?
Well, I don't arrive in Monterey until 4:30 that afternoon. How about
8pm and if Kernighan isn't around maybe Larry would suffice :)
e.
------------------------------
Date: Thu, 12 Aug 1999 09:52:57 -0400
From: Elaine -HFB- Ashton <elaine@chaos.wustl.edu>
Subject: Re: Looking for a good Perl Book
Message-Id: <37B2D145.AB8152F1@chaos.wustl.edu>
Uri Guttman wrote:
> i can't make it. i'll be flying to monterey that day. :-)
Me too :) I'll be at the beach. I've always fancied a Vegas drive-thru
wedding anyway.
> where will you be registered? i can send a copy of OO Perl to you!
What?! No toaster?! Bring a copy of the book tonight! :)
e.
------------------------------
Date: Thu, 12 Aug 1999 10:18:05 -0400
From: Elaine -HFB- Ashton <elaine@chaos.wustl.edu>
Subject: Re: Looking for a good Perl Book
Message-Id: <37B2D728.64116071@chaos.wustl.edu>
Abigail wrote:
> Perhaps it's my scientific heritage, but one of the keys things I
> judge technical/scientific works by is the quality of the references
> section. There is no references section in the Camel.
And the index is woefully inadequate. I don't know who wrote the recent
feature on ora.com about their 'indexing guru' but I laughed. None of
the O'Reilly books have a decent index with cross references, not even
the nutshells.
> Mind, I am not claiming that the Camel is a bad book. Not at all.
> But anything that comes from O'Reilly seems to have this "holy aura"
> (not only the Perl books). I've no idea why. O'Reilly has produced
> some good books, and I've somewhere between 15 and 20 O'Reilly books
> myself. But I've yet to see any really outstanding book from O'Reilly,
> and in my opinion, O'Reilly books are highly overrated. There is too
> much "The author(s) is God, what (s)he says are facts, that don't
> have to be motivated" (paraphrasing Jeffrey Friedl).
Before they started going for the windows market and such, the system
administration book was very solid as was the sendmail and dns books. I
don't know if God writes for O'Reilly, but if he did, he would choose a
better typeface, kerning and layout with better indexing :)
> We all whine about the people asking question here that are found in the
> faq, or the manual. But sometimes we should realize it isn't easy to
> find things.
This is very true as sometimes, when I'm double checking something to
make sure I'm answering a question correctly, it takes me more effort to
find the information. Some stuff is intuitive and obvious, some is
obscure and you really have to read all several hundred pages of the
pods to know where to look. I still think a cross-referenced index would
serve the documentation well.
> I wish there was something better than the online documentation. We
> need something better. But I also realize it's damn near impossible to
> create something better.
I think a well done index would cure a lot of ills. Of course, this is a
very difficult task itself.
> Well, when I started my CS degree at the university, back in the first
> half of the '80s, we were supposed to learn Unix from Kernighan and Pikes
> "The UNIX Programming Environment". The book is geared towards beginners,
> and I've found it a very useful book. It's almost falling apart, it's by
> far the most worn out book in my technical bookcase, and if it wasn't
> for the fact I started to learn Perl a couple of years ago, I'd still
> be using it on a regular basis.
My K&P is right next to vol 1 & 2 of Bell Labs "Unix Programmer's
Manual" on my bookshelf....yellow and decaying but still great books.
Most of my O'Reilly's and other books are outdated or seem to be anyway.
e.
------------------------------
Date: 12 Aug 1999 09:42:39 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Looking for a good Perl Book
Message-Id: <slrn7r5nad.e3e.abigail@alexandra.delanet.com>
Anno Siegel (anno4000@lublin.zrz.tu-berlin.de) wrote on MMCLXXII
September MCMXCIII in <URL:news:7oubjg$qis$1@lublin.zrz.tu-berlin.de>:
.. Abigail <abigail@delanet.com> wrote in comp.lang.perl.misc:
..
.. >I'd trade all Unix books from O'Reilly for any book written by Kernighan
.. >or Pike.
..
.. Is there more than one?
I have at least 3 books written by Kernighan, 2 of which he has written
together with Pike.
Abigail
--
perl -we '$_ = q ?4a75737420616e6f74686572205065726c204861636b65720as?;??;
for (??;(??)x??;??)
{??;s;(..)s?;qq ?print chr 0x$1 and \161 ss?;excess;??}'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 12 Aug 1999 09:43:10 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Looking for a good Perl Book
Message-Id: <slrn7r5nbc.e3e.abigail@alexandra.delanet.com>
Elaine -HFB- Ashton (elaine@chaos.wustl.edu) wrote on MMCLXXII September
MCMXCIII in <URL:news:37B2D082.9DB03D5C@chaos.wustl.edu>:
;; Abigail wrote:
;; > ;; abigail++ :) Marry me darling.
;; >
;; > Sure. How about Friday, Aug 20, around 3ish?
;; >
;; > You'd think Kernighan would like to be the best man?
;;
;; Well, I don't arrive in Monterey until 4:30 that afternoon. How about
;; 8pm and if Kernighan isn't around maybe Larry would suffice :)
Oh, dear. We have a problem. I won't be going to Monterey.
Abigail
--
package Just_another_Perl_Hacker; sub print {($_=$_[0])=~ s/_/ /g;
print } sub __PACKAGE__ { &
print ( __PACKAGE__)} &
__PACKAGE__
( )
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 12 Aug 1999 09:31:41 -0400
From: dblack@pilot.njin.net (David Alan Black)
Subject: Re: Newbie? => Merging 2 files to a third file
Message-Id: <7ouibt$4s3$1@pilot.njin.net>
bobby1233847@my-deja.com writes:
>HI,
> having probs. with the foll. code
>I want to merge 2 files to a third file like
>This is line1 from file1
>This is line2 from file2
>...
>and so on..
(I assume you mean "line1 from file2" - ?)
print OUT while length($_ = <IN1> . <IN2>);
Are there risks and/or more wastefulness than I think (i.e., more
than not much) associated with the possibility of repeatedly
trying to read past EOF (which will happen if one file is
longer than the other)?
David Black
--
David Alan Black blackdav@shu.edu or dblack@pilot.njin.net
Associate Professor Seton Hall University
Department of Communication South Orange, NJ 07079
http://pirate.shu.edu/~blackdav includes Syllabus Markup Language (SyML)
------------------------------
Date: Thu, 12 Aug 1999 08:53:17 -0500
From: "Keith G. Murphy" <keithmur@mindspring.com>
Subject: Re: NO-ONE USES PERLQT ! Godwin does!
Message-Id: <37B2D1CD.647246D5@mindspring.com>
> And even guys like hitler denied some
Godwin's law is hereby invoked. Move along, folks. It's all over.
Nothing to see here.
------------------------------
Date: Thu, 12 Aug 1999 14:19:53 GMT
From: marcel.grunauer@lovely.net (Marcel Grunauer)
Subject: Re: NO-ONE USES PERLQT !!!!!!!!!!!!!!!!!!!!!?????????????????????????
Message-Id: <37c9e3a7.22090514@news>
On Thu, 12 Aug 1999 09:59:19 +0200, Thomas Schmickl
<schmickl@magnet.at> wrote:
>My point was, that in our country there has bean a time where some people
>thought they
>were better than others. This has nothing to do with your been jewish or
>something else
>now in 1999 in america. It gives you no better view to those things, just
>because of
>your religion. (The nazis kill(fil)ed jews, socialists, roma, handicapped ...).
Oh for god's sake.
People like you give other Austrians a bad reputation. If you don't
agree with this group's way of handling things, don't post to it or
even read it. No-one forces you to.
If you're not comfortable with English, hie you hence to
de.comp.lang.perl.*.
And fix your newsreader.
*plonk*
Sinngemaesse deutsche Uebersetzung fuer Herrn Schmickl:
Leute wie Du ruinieren den Ruf anderer Oesterreicher (wir sind nicht
alle so paranoid wie Du). Wenn Du nicht mit der Art, wie diese
newsgroup die Dinge handhabt, einverstanden bist, dann brauchst Du sie
ja nicht zu lesen oder hier zu posten.
Wenn Du lieber in Deutsch kommunizierst, geh halt zu
de.comp.lang.perl.*
Und konfiguriere Deinen Newsreader (auf 72 Zeichen pro Zeile).
Willkommen im killfile.
Marcel
--
perl -e 'print unpack(q$u$,q$82G5S="!!;F]T:&5R(%!E<FP@2&%C:V5R$)'
------------------------------
Date: 12 Aug 1999 14:25:12 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: p5p flamage (was Re: reference to object method)
Message-Id: <7oulg8$5uk$3@info2.uah.edu>
In article <x7g11p9agt.fsf@home.sysarch.com>,
Uri Guttman <uri@sysarch.com> writes:
: >>>>> "GB" == Greg Bacon <gbacon@itsc.uah.edu> writes:
:
: GB> C<use strict 'methods'> anyone? Breakage bad, progress good.
:
: post it to p5p and put on your flame retardant pajamas.
People whine, gripe, and complain about p5p's attitude toward changes
to the Holiest of Holies, but I like it that way. The fact that changes
to the core are subject to such scrutiny is a sign that people really and
truly care about Perl and its future. Pumpkings could apply every patch
that crosses p5p as a matter of policy, but down that path lies NT. :-)
Greg
--
So far as I can remember, there is not one word in the Gospels in
praise of intelligence.
-- Bertrand Russell
------------------------------
Date: Thu, 12 Aug 1999 14:45:14 GMT
From: rand@qualityic.com (Rand Bamberg)
Subject: Re: Parse::RecDescent, optional subrules, and errors
Message-Id: <37b2da3a.8645405@news.jump.net>
On 11 Aug 1999 21:41:09 GMT, damian@cs.monash.edu.au (Damian Conway)
wrote:
>This is because the errors generated by optional subrules are
>currently pruned at the *end* of the enclosing rule. When 'rev(?)' is
>part of 'headers', the message gets pruned at the end of 'headers'
>(i.e. before 'fruit' is tried). When 'rev(?)' is part of 'file',
>the error isn't pruned till the end of 'file', so it's still around
>when 'fruit' fails.
Thanks for taking the time to clarify what I was seeing, it
helps solidify what I'd pieced-together from your TPJ article
and the pod...
>> Any ideas on what's going on here, or, at least, how I
> can get the desired behaviour without in-lining?
>
>There's no way you can at present :-(
How about an extension to <error> (<error!>, maybe)
that would always force an error and disable pruning thereof?
The grammar(s) I'm writing are very unambiguous; I'd like to
diagnose/report badly-formed optional constructs this way.
Just an idea; I have plenty of maneuvering room.
>Clearly the error pruning heuristics need another tweak.
>I'll queue it in my ToDo file.
And an impressive ToDo file it must be! ;-) I'm looking
very forward to your 2.0 release, and your book. ...Have
you thought about setting up a mailing list for Parse::RecDescent?
It would be a convenient place to archive FAQs like this,
at least, and spare you some cycles...
Thanks again,
Rand.
------------------------------
Date: Thu, 12 Aug 1999 13:16:45 GMT
From: f00baz@my-deja.com
Subject: Passing named and unnamed parameters to subs
Message-Id: <7ouhfk$2hf$1@nnrp1.deja.com>
Hello people,
I've been checking several modules (namely CGI.pm),and found a neat way
(and very convinient one) of passing named parameters to subs, so I
wonder what would be the better approach here. I checked the module
code itself, but it uses some routine of its own, which is deeply
interlaced with the rest of code. However, playing with some bits
myself I figured out that thing like:
&foo( -name1 => 'foo',
-name2 => 'baz');
sub foo {
my ($param, $param1,$default);
my $test=(@_);
$default='default_value';
if ($test =~ /^-[a-z]+/) { # named parameters are passed
my %_=@_;
my $param=$_{'name1'} || $default;
my $param1=$_{'name2'} || $defaut;
} else {
my $param=shift || $default;
my $param1=shift || $default;
}
....
}
but I am curious if there's a better approach of doing such a thing,
since my code looks somewhat ugly.
regards,
~F.
--
'oh, no, another day?'
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Thu, 12 Aug 1999 13:41:27 GMT
From: snowhare@long-lake.nihongo.org (Benjamin Franz)
Subject: Re: Passing named and unnamed parameters to subs
Message-Id: <baAs3.36$663.3012@typhoon01.swbell.net>
In article <7ouhfk$2hf$1@nnrp1.deja.com>, <f00baz@my-deja.com> wrote:
>I've been checking several modules (namely CGI.pm),and found a neat way
>(and very convinient one) of passing named parameters to subs, so I
>wonder what would be the better approach here.
Take a look at 'Class::NamedParms' and 'Class::ParmList' on CPAN.
--
Benjamin Franz
------------------------------
Date: Thu, 12 Aug 1999 10:37:57 -0400
From: Elaine -HFB- Ashton <elaine@chaos.wustl.edu>
Subject: Re: Perl is eating up my memory
Message-Id: <37B2DBD0.F195F388@chaos.wustl.edu>
Abigail wrote:
> "" I run the script on a SUN Ultra5 with 128M and Solaris. I use 'top' command
> "" to watch how much memory is used.
>
> I'm a bit surprised. I've a Sun Ultra5 as well, with 128M RAM, and
> Solaris 2.7. But it happely munches on even if a process uses 240 Mb
> of memory. Perhaps you want to increase your swap space?
Top is never a good tool for actual memory useage. Read this sunworld
article
http://www.sunworld.com/sunworldonline/swol-03-1998/swol-03-perf.html
and get the tools which will really enlighten on how memory is allocated
and used. Also, there are many other performance issues to consider with
how much memory a single process consumes. More memory isn't always the
right answer but I never like to see a machine with a database running
with less than 256mb real.
And read
http://wwwwseast.usec.sun.com/sun-on-net/performance/vmsizing.pdf
...which is far more than you ever wanted to know about the solaris
memory system. :)
e.
------------------------------
Date: Thu, 12 Aug 1999 07:15:32 -0700
From: "Luke Cowell" <systems@imag.net>
Subject: Re: perl won't complie with Berkeley DB
Message-Id: <NEAs3.3617$M5.18310@newsfeed.slurp.net>
I was kinda hoping for a more contrete answer.
> >Checking Berkeley DB version ...
> >I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB.
>
> So it probably doesn't like your version of DB or maybe it can't find
> the header file.
>
We see that it does find the header file, but doesn't like it.
> >This may or may not have anything to do with it, but when I try to use
> >DB_File i get this message when I try to run it.
>
> [ snip ]
>
> yes, that's because you didn't build DB support into it.
>
Well I know that...... and building perl with db support is what I'm trying
to do!!
Can someone please help!!
Luke
------------------------------
Date: Thu, 12 Aug 1999 09:06:05 -0400
From: Patrick Tully <pmt@top.mitre.org>
Subject: Read/Retrieve Romote html document?
Message-Id: <37B2C6BD.DE741341@top.mitre.org>
Hi, I was wondering if there was a way to read a remote html file
in perl (NOT using the Location: header). I would like to be able to
insert partial text/html from a remote html file into my web page via
SSI. SSI doesn't allow remote pages to be included, but it will allow
me to execute a perl program inside the page (and no, a location header
will not work for this purpose). Is there some kind of open() funciton
that will let me read the remote data? Is there a better way of doing
this (javascript?)? Thanks for any suggestions,
-Pat T.-
tcblue82@yahoo.com
------------------------------
Date: Thu, 12 Aug 1999 10:02:34 -0400
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: Read/Retrieve Romote html document?
Message-Id: <Pine.GSO.4.10.9908121001350.2484-100000@crusoe.crusoe.net>
[posted & mailed]
On Aug 12, Patrick Tully blah blah blah:
> Hi, I was wondering if there was a way to read a remote html file
perldoc -q fetch
perldoc perlfaq9
=head2 How do I fetch an HTML file?
One approach, if you have the lynx text-based HTML browser installed
on your system, is this:
$html_code = `lynx -source $url`;
$text_data = `lynx -dump $url`;
The libwww-perl (LWP) modules from CPAN provide a more powerful way to
do this. They work through proxies, and don't require lynx:
# simplest version
use LWP::Simple;
$content = get($URL);
--
jeff pinyan japhy@pobox.com
perl stuff japhy+perl@pobox.com
CPAN ID: PINYAN http://www.perl.com/CPAN/authors/id/P/PI/PINYAN
------------------------------
Date: Thu, 12 Aug 1999 10:29:30 -0400
From: <stirling@banet.net>
Subject: Re: Read/Retrieve Romote html document?
Message-Id: <37b2d8a7@news1.us.ibm.net>
There is a Webreview article on this go to
http://webreview.com/wr/pub/98/10/30/perl/index.html, and no there is not a
better way to do this in javascript
--
Yours Sincerely,
Stirling
Patrick Tully wrote in message <37B2C6BD.DE741341@top.mitre.org>...
> Hi, I was wondering if there was a way to read a remote html file
>in perl (NOT using the Location: header). I would like to be able to
>insert partial text/html from a remote html file into my web page via
>SSI. SSI doesn't allow remote pages to be included, but it will allow
>me to execute a perl program inside the page (and no, a location header
>will not work for this purpose). Is there some kind of open() funciton
>that will let me read the remote data?
There is a Webreview article on this go to
http://webreview.com/wr/pub/98/10/30/perl/index.html
> Is there a better way of doing
>this (javascript?)? Thanks for any suggestions,
no
-Stirling
------------------------------
Date: Thu, 12 Aug 1999 18:51:33 +1000
From: "Shalabh Chaturvedi" <shalabh@pspl.co.in>
Subject: Re: Run a script from a web browser and put it in the background
Message-Id: <7ovm5g$kid$1@news.vsnl.net.in>
Please check another posting "CGI Timeout Problem" in this group.
Guideline Chan <yoursguideline@hotmail.com> wrote in message
news:37B18958.3266BEB0@hotmail.com...
> I want to run a script from a web browser. This script may take 5
> minutes to process such as gzip a file. So put this in the background is
> preferrable and display the result to the client after finishing.
> However the problem is that a web browser is still loading.
>
> How can I stop the browser loading but process the progress in the
> background and put the result back to the client after finishing ???
>
> --
> thanks
>
------------------------------
Date: Thu, 12 Aug 1999 10:21:25 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: s/// and interpolation
Message-Id: <linberg-1208991021250001@ltl1.literacy.upenn.edu>
In article <MPG.121bc033ad839a44989e40@nntp.hpl.hp.com>, lr@hpl.hp.com
(Larry Rosler) wrote:
> In article <linberg-1108991523490001@ltl1.literacy.upenn.edu> on Wed, 11
> Aug 1999 15:23:49 -0400, Steve Linberg <linberg@literacy.upenn.edu>
> says...
> ...
> > Like I said, any use of "eval" should throw up blasting red lights and
> > sirens.
>
> Just to clarify for the unaware, you mean 'eval STRING'. Uses of 'eval
> BLOCK' are quite different and quite benign.
Right, thanks for the clarification.
--
Steve Linberg, Systems Programmer &c.
National Center on Adult Literacy, University of Pennsylvania
Be kind. Remember, everyone you meet is fighting a hard battle.
print 'Just Another Perl ' . $perl_hierarchy[(USER+EXPERT)/2];
------------------------------
Date: Thu, 12 Aug 1999 10:23:20 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: s/// and interpolation
Message-Id: <linberg-1208991023200001@ltl1.literacy.upenn.edu>
In article <826qx@questionexchange.com>, QuestionExchange
<USENET@questionexchange.com> wrote:
> $search = '(\d{3})-(\d{2})-(\d{4})' ;
> $replace = 'ID#$1$2$3' ;
> $repStr = "s/".$search."/".$replace."/" ;
> eval ($repStr);
> I may make some mistakes, but principle is right. Hope this
> helps you.
You're aware of the gigantic security hole created by this solution,
right? (Elsewhere in this thread.)
--
Steve Linberg, Systems Programmer &c.
National Center on Adult Literacy, University of Pennsylvania
Be kind. Remember, everyone you meet is fighting a hard battle.
print 'Just Another Perl ' . $perl_hierarchy[(USER+EXPERT)/2];
------------------------------
Date: 12 Aug 1999 14:32:32 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: Sesssion ID
Message-Id: <7oulu0$5uk$4@info2.uah.edu>
In article <Pine.OSF.3.95q.990812134128.9145E-100000@cpca4.uea.ac.uk>,
Paul Russell <x9730915@uea.ac.uk> writes:
: Yeah, you could put the username in a cookie if you just want to know
: who the person is.
...or enable authentication and examine $ENV{REMOTE_USER}. Not everyone
enables cookies.
Greg
--
Sam: What'd you like, Normie?
Norm: A reason to live. Gimmie another beer.
------------------------------
Date: 12 Aug 1999 14:41:27 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: Testing (Please disregard)
Message-Id: <7oumen$5uk$6@info2.uah.edu>
In article <37b06624.5203709@news.swbell.net>,
chrisl@tourneyland.com (Chris) writes:
: Please disregard this posting
:
: (Sorry to do this, but my last 5 or 6 postings haven't made it to the
: group, and I'm trying to fix the problem)
This newsgroup is for discussion related to the Perl programming
language. There are several groups dedicated to testing:
alt.test
misc.test
misc.test.moderated
Please avail yourself of these resources.
Greg
--
The greatest dangers to liberty lurk in insidious encroachment by men
of zeal, well-meaning but without understanding.
-- Justice Louis D. Brandeis
------------------------------
Date: Thu, 12 Aug 1999 10:04:19 -0400
From: "William E. Klint" <william.klint@daytonoh.ncr.com>
Subject: User Agent & SSL
Message-Id: <37B2D463.9DFEF4F@daytonoh.ncr.com>
Does anyone know of a User Agent, similar to that in LWP::Simple, that
supports the "https" protocol?
------------------------------
Date: Thu, 12 Aug 1999 13:44:50 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: while loop teminates too early
Message-Id: <37b4aebd.1721404@news.skynet.be>
Larry Rosler wrote:
>> that should be "while(defined( $line = <USERS> ))". what happens if
>> you've got a line that evaluates to false?
>
>Please don't perpetuate that nonsense.
>
>For a while, in perl 5.004, there was a warning about that 'problem',
>which could *never* occur in any real-life situation dealing with valid
>'text files' (and if they aren't text files, why would one be reading
>them a 'line' at a time?).
Huh?
open OUT,">test.txt";
print OUT "5\n4\n3\n2\n1\n0";
close OUT;
Are you saying this isn't a text file? It sure looks like one, to me.
And yet, that problem did occur with it. BTW it does occur, without any
warning, with older Perl versions.
It was indeed solved with 5.005 (the "defined" is implied), so it will
no longer fail.
Bart.
------------------------------
Date: 12 Aug 1999 13:44:03 GMT
From: fl_aggie@thepentagon.com (I R A Darth Aggie)
Subject: Re: Why ?
Message-Id: <slrn7r5k16.g8f.fl_aggie@thepentagon.com>
On Thu, 12 Aug 1999 15:02:52 +0200, mock <mock@knapp.co.at>, in
<37B2C5FC.21840839@knapp.co.at> wrote:
+ Afgin Shlomit schrieb:
[note: when populating an array or hash with string constants, you
don't have to use "s, but you can instead use 's, or if spaces aren't
significant, you may
@words=qw|word1 word2 word3|;
]
+ > $stam{'$variables[$i]'} = "xxx$i";
+ your problem is a misuse of '$variables[$i]'. single quoted strings
+ will not be expanded (interpolated).
Ok, so far, so good..
+ use instead double quotes
+ ("$variables[$i]") if you wanna get a Hash with elements like
+ $stam{'First Name'}, $stam{'Last Name'}...
No. Bad. No. Unnecessary!
The original: $stam{'$variables[$i]'} = "xxx$i";
What it should be: $stam{$variables[$i]} = "xxx$i";
No quotes necessary.
James
--
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN/doc/FAQs/cgi/idiots-guide.html>
------------------------------
Date: Thu, 12 Aug 1999 07:51:20 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Why ?
Message-Id: <MPG.121c7f372cb149a6989e47@nntp.hpl.hp.com>
In article <37B2C5FC.21840839@knapp.co.at> on Thu, 12 Aug 1999 15:02:52
+0200, mock <mock@knapp.co.at> says...>
> Afgin Shlomit schrieb:
[using a rather foolish Subject]
> > I have a very strange problem with perl, at list to me.
> > part of the source look:
> > my @variables = ("First Name","Last Name","Department","Position","EMail ",
> > "Human Genomic sequences",
> > "Genbank", "Genecards", "Unigene", "Epd", "Other",
> > "Mapping Databases",
> > "Udb", "Udg", "Genemap", "Other",
> > "Resources",
> > "Other", "Local resources", "Comments");
<SNIP of unused array>
> > my $tt;
> > for ($i = 0; $i <=$#variables; $i++) {
> > $stam{'$variables[$i]'} = "xxx$i";
> > $tt = $variables[$i];
> > print "$variables[$i]:\t$stam{'$variables[$i]'}\n";
> > }
>
> your problem is a misuse of '$variables[$i]'. single quoted strings will not be expanded
> (interpolated). use instead double quotes ("$variables[$i]") if you wanna get a Hash
> with elements like $stam{'First Name'}, $stam{'Last Name'}...
Using double-quotes around simple scalar variables is misleading. Just
$stam{$variables[$i]} is best, not $stam{"$variables[$i]"}.
> have a nice day and keep on writing perl
> klaus
<SNIP of remainder of the post, not commented on. Why quote it?>
> begin:vcard
<SNIP of remainder of inappropriate noise for a Usenet posting>
A couple more comments:
Elementary Perl style tip: When *not* interpolating (such as in the
initialization of your arrays), use of single-quotes is more appropriate
than use of double-quotes.
Intermediate Perl technique tip: Initialization of the hash can be done
much more cleanly and rapidly using a 'hash slice':
@stam{@variables} = map "xxx$_" => 0 .. $#variables;
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 12 Aug 1999 13:44:52 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Why use Perl when we've got Python?!
Message-Id: <37b5b272.2670618@news.skynet.be>
Ian Clarke wrote:
>> Perl was originally written for a specific purpose. It's goal was to get
>> things done quickly and efficiently.
>
>I think you could say that python was written to get things done
>quickly, efficiently, and with some hope of readability too.
No, Python was created with "uniformity" in mind. Whatever you do, it
all uses basically the same syntax.
Perl has a syntax that is specific for it's task. Regexes and bit
twiddling are conceptially NOT the same thing. So why should you want it
to look as if it is?
Regexes in Python are pretty awkward, just like creating Windows
programs in plain C is.
Bart.
------------------------------
Date: 12 Aug 1999 13:50:13 GMT
From: fl_aggie@thepentagon.com (I R A Darth Aggie)
Subject: Re: Why use Perl when we've got Python?!
Message-Id: <slrn7r5kco.g8f.fl_aggie@thepentagon.com>
On Thu, 12 Aug 1999 09:31:05 +0100, Ian Clarke <I.Clarke@strs.co.uk>, in
<37B28649.9C7F0C1E@NOSPAM.strs.co.uk> wrote:
+ I am glad you could care less, but if someone would only provide me with
+ some solid reasons for why I might want to use Perl over Python (other
+ than wishy washy "Perl is more efficient to code in" or "I tried Python
+ and didn't like it" comments) then I might consider trying Perl.
Why do you need reasons to try perl? why don't you just *use* it and come
to your own conclusion. Or how are you going to, in your words:
How can you choose the best tool for a job, if you know nothing about
other tools?
James - as a fortran programmer, I can make any language unreadable...
--
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN/doc/FAQs/cgi/idiots-guide.html>
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 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.
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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu.
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 480
*************************************