[9131] in Perl-Users-Digest
Perl-Users Digest, Issue: 2749 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 28 13:07:49 1998
Date: Thu, 28 May 98 10:01:38 -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 Thu, 28 May 1998 Volume: 8 Number: 2749
Today's topics:
Re: how to init three dimentional array using perl <jll@skynet.be>
Re: HOWTO : UDP ping ? (Greg Lindahl)
Re: HOWTO : UDP ping ? <playinmantis@earthlink.net>
Re: Job Postings (Stuart McDow)
Re: Job Postings (Stuart McDow)
Re: list context: || vs or (Matt Knecht)
Re: new to OO Perl <lr@hpl.hp.com>
Page redirection slide show AlexLesniara@my-dejanews.com
Re: Page redirection slide show (brian d foy)
perl monger tshirt??? <quednauf@nortel.co.uk>
Re: perl monger tshirt??? (Nathan V. Patwardhan)
Re: perl monger tshirt??? (Jim Allenspach)
Re: perl monger tshirt??? (brian d foy)
Re: Possible to "skip" a record? <dk@tundra.winternet.com>
Re: Problem de-referencing a reference to a typeglob st (Sitaram Chamarty)
Reading whole file into a scalar <mdolan@best.com>
Re: Statistics for comp.lang.perl.misc (Greg Lindahl)
Re: Tom Christiansen attacks the free software communit (Greg Lindahl)
Re: Visibility of "my" vars (M.J.T. Guy)
Re: Wanted: info on passing args to functions in perl5 (John Porter)
Re: Why does "each" not go thru entire hash?? <aqumsieh@matrox.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 28 May 1998 17:35:57 +0200
From: Jean-Louis Leroy <jll@skynet.be>
Subject: Re: how to init three dimentional array using perl
Message-Id: <VA.000000c1.531a58ac@jll>
>> Dear expert
I'm not an expert but I'll try to help.
My best suggestion is: get yourself a Camel. Read it thoroughly. It's
all explained there.
The following transformation of your code preserves the C-ish feel, but
it's certainly not the best, nor most efficient way.
for ($in = 0; $in < 12; $in++)
{
for ($shop =0; $shop < 119; $shop++)
{
for ($trans=0; $trans<99; $trans++)
{
$isarray->[$in][$shop][$trans] = 0;
}
}
}
This makes $isarray a reference to a three-dimensional array (assuming
that $isarray was previously undefined).
Note that Perl arrays begin at index 0 (notwithstanding a
now-deprecated feature).
Jean-Louis Leroy
http://ourworld.compuserve.com/homepages/jl_leroy
------------------------------
Date: 28 May 1998 14:31:05 GMT
From: lindahl@pbm.com (Greg Lindahl)
Subject: Re: HOWTO : UDP ping ?
Message-Id: <6kjsf9$sk0@news1.newsguy.com>
Zenin <zenin@bawdycaste.org> writes:
> ...Where did you get this above "quote"? It's not from the
> current Net::Ping, which does fully support UDP, TCP, and ICMP
> (with root ID) ping.
I got that quote from the version of Net::Ping installed on my RedHat
4.2 box. I'm glad to see it's been updated.
-- g
------------------------------
Date: Thu, 28 May 1998 09:30:52 -0700
From: Matthew Purdon <playinmantis@earthlink.net>
To: Douglas Clifton <doug@weboneinc.net>
Subject: Re: HOWTO : UDP ping ?
Message-Id: <356D913C.97F9AC5E@earthlink.net>
I've been following this thread because I have a similar problem.
I have yet to get either the ping or pingecho method to work for any
protocol using the net::ping module in Sarathy's Win32 binary version.
No one replied to my posting from two days ago, so I have a feeling, no
one else has ever successfully used this module in win32.
Any solutions would be greatly appreciated.
------------------------------
Date: 28 May 1998 15:23:29 GMT
From: smcdow@arlut.utexas.edu (Stuart McDow)
Subject: Re: Job Postings
Message-Id: <6kjvhh$mjg$1@ns1.arlut.utexas.edu>
mgjv@comdyn.com.au (Martien Verbruggen) writes:
>
> foreach (@reader_capj)
> {
> $_->read_newsgroups(match_newsgroups(\.jobs?\.))
> }
> }
for (readers_curious_about_perl_jobs()) {
if(actively_seeking_employment($_)) {
read_newsgroups($_, match_newsgroups(\.jobs?\.));
} else {
print "okay to post";
}
}
IMO, of course. :-)
--
Stuart McDow Applied Research Laboratories
smcdow@arlut.utexas.edu The University of Texas at Austin
"Look for beauty in roughness, unpolishedness"
------------------------------
Date: 28 May 1998 16:11:32 GMT
From: smcdow@arlut.utexas.edu (Stuart McDow)
Subject: Re: Job Postings
Message-Id: <6kk2bk$3ic$1@ns1.arlut.utexas.edu>
Whoops, I need to revise this.....
smcdow@arlut.utexas.edu (Stuart McDow) writes:
>
> for (readers_curious_about_perl_jobs()) {
> if(actively_seeking_employment($_)) {
> read_newsgroups($_, match_newsgroups(\.jobs?\.));
> } else {
> print "okay to post";
> }
> }
for (readers_curious_about_perl_jobs()) {
if(actively_seeking_employment($_)) {
read_newsgroups($_, match_newsgroups(\.jobs?\.));
} else {
if(inflicted_with_False_Laziness($_)) {
print "okay to post";
} else {
DejaNewsSearch($_, q( ~g *jobs* ));
}
}
}
--
Stuart McDow Applied Research Laboratories
smcdow@arlut.utexas.edu The University of Texas at Austin
"Look for beauty in roughness, unpolishedness"
------------------------------
Date: Thu, 28 May 1998 16:39:51 GMT
From: hex@voicenet.com (Matt Knecht)
Subject: Re: list context: || vs or
Message-Id: <rrgb1.342$_3.2259983@news2.voicenet.com>
Jaime Metcher <metcher@spider.herston.uq.edu.au> wrote:
>Sure, when it says ARRAY you can't use just any old list. But when it
>says LIST you *can* use an array, n'est ce pas? Forget it, my
>suggestion wasn't really any clearer.
>
>Anyway, after much camel-searching and reading the rest of this thread,
>I've come to this conclusion: Tom (and Larry and Randall) - you've done
>what you can. You've documented the sucker to death. But, as you
>mentioned in your Y2K piece, you can't fix the wetware.
It was my question that started this whole thread. And, after reading
through a lot of excellent replies, and diving back to the books, I
finally figured it out. What made it click for me was Tom
Christiansen's remark that a list isn't an AV, but just some
numbers on a stack somewhere. This comment, which I didn't really
understand at the time, lead me to chapter 20 of the Panther. It's a
very illuminating chapter on the guts of Perl. I'm sure it'll take
quite some time before I finally figure out all of that chapter, but,
having this question in mind and going over it helped me immensly. I
highly recommend it.
Oh, you're right. You can't fix the wetware. It has to fix itself.
--
Matt Knecht + <hex@voicenet.com>
------------------------------
Date: Thu, 28 May 1998 08:52:05 -0700
From: "Larry Rosler" <lr@hpl.hp.com>
Subject: Re: new to OO Perl
Message-Id: <6kk17v$53g@hplntx.hpl.hp.com>
John Porter wrote in message ...
>On Wed, 27 May 1998 11:17:30 -0400,
>in article <356C2E8A.B8DE906F@ral1.zko.dec.com>,
>jc@ral1.zko.dec.com (John Chambers) wrote:
>> John Porter wrote:
>> >
>> > Make the following substitutions throughout your code:
>> > In place of: Use:
>> > $props{$key} $self->{'props'}{$key}
>> > %props %{$self->{'props'}}
>> > $format[$index] $self->{'format'}[$index]
>> > @format @{$self->{'format'}}
>> > (for all values of $key and $index)
...
>And then there's the issue of efficiency in the big scheme of
>things. I don't care if my program takes 10 minutes to run
>instead of one, if I can write it in 10 minutes instead of
>an hour. I think that's been beaten to death; search DejaNews.
>
>John Porter
Well, *my* users care if the [CGI] program I write for them to use
[several times a day] takes 10 seconds to run instead of one, so I may
have to write it in 10 hours instead of an hour. (Actually, 10 months
is more like it!)
The point is, it all depends. After choosing efficient algorithms,
there are still those pesky multiplicative factors ignored in computing
algorithmic complexity. And your table above shows clearly that OO
increases those factors.
The benefits of OO, in particular data abstraction and hiding, seem to
me to be valuable only for maintaining the integrity of large programs
being worked on by many hands ("programming in the large"). I'm not
convinced that Perl is the right medium for such programs, nor have I
seen evidence that Perl is in fact being used that way.
I don't see how OO helps you write your write-fast/run-slow program
faster, but I can certainly see how it helps it run slower.
<FLAME ON> or <ENLIGHTENMENT ON>???
--
Larry Rosler
Hewlett-Packard Laboratories
lr@hpl.hp.com
------------------------------
Date: Thu, 28 May 1998 15:54:40 GMT
From: AlexLesniara@my-dejanews.com
Subject: Page redirection slide show
Message-Id: <6kk1c1$dng$1@nnrp1.dejanews.com>
I know I can use print "Location: ....
to redirect to other pages on the web.
But I would like to be able to do something like this:
print "Location: http://www.domain1.com\n\n";
print "Location: http://www.domain2.com\n\n";
print "Location: http://www.domain3.com\n\n";
etc.
Is this doable?
Thanks
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Thu, 28 May 1998 12:51:29 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Page redirection slide show
Message-Id: <comdog-ya02408000R2805981251290001@news.panix.com>
Keywords: from just another new york perl hacker
In article <6kk1c1$dng$1@nnrp1.dejanews.com>, AlexLesniara@my-dejanews.com posted:
>I know I can use print "Location: ....
>to redirect to other pages on the web.
>But I would like to be able to do something like this:
>
>print "Location: http://www.domain1.com\n\n";
>print "Location: http://www.domain2.com\n\n";
>print "Location: http://www.domain3.com\n\n";
Look for WebAutoPilot by Matthew Gray, along with all sorts of
similar thingys out there.
good luck :)
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers T-shirts! <URL:http://www.pm.org/tshirts.html>
------------------------------
Date: Thu, 28 May 1998 15:57:03 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: perl monger tshirt???
Message-Id: <356D7B3F.E948E0C9@nortel.co.uk>
Has anyone got one of these? Are they any good? Are there other
Perl shirts?
--
____________________________________________________________
Frank Quednau
http://www.surrey.ac.uk/~me51fq
________________________________________________
------------------------------
Date: 28 May 1998 15:11:19 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: perl monger tshirt???
Message-Id: <6kjuqn$s5b@fridge.shore.net>
F.Quednau (quednauf@nortel.co.uk) wrote:
: Has anyone got one of these? Are they any good? Are there other
: Perl shirts?
The shirts are very pretty: white on black. Nice camel logo. I
definitely plan to wear mine as part of my regular rotation of Ozzy
Osbourne, Judas Priest and Megadeth wear.
--
Nate Patwardhan|root@localhost
"Fortunately, I prefer to believe that we're all really just trapped in a
P.K. Dick book laced with Lovecraft, and this awful Terror Out of Cambridge
shall by the light of day evaporate, leaving nothing but good intentions in
its stead." Tom Christiansen in <6k02ha$hq6$3@csnews.cs.colorado.edu>
------------------------------
Date: 28 May 1998 11:21:37 -0500
From: jima@MCS.COM (Jim Allenspach)
Subject: Re: perl monger tshirt???
Message-Id: <6kk2uh$nkr@Mercury.mcs.net>
"F.Quednau" <quednauf@nortel.co.uk> writes:
>Are there other
>Perl shirts?
There's at least one other: the "Learning Perl" shirts from
O'Reilly. Unfortunately, I don't think they're available anymore, so
I'll be keeping mine in a climate-controlled environment (i.e., Chicago).
Anyone know if the Perl Conference will have its own T-shirts?
jma
------------------------------
Date: Thu, 28 May 1998 12:37:27 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: perl monger tshirt???
Message-Id: <comdog-ya02408000R2805981237270001@news.panix.com>
Keywords: from just another new york perl hacker
In article <356D7B3F.E948E0C9@nortel.co.uk>, "F.Quednau" <quednauf@nortel.co.uk> posted:
Be a Perl Monger! Start a Perl user group in your area! see
<URL:http://www.pm.org> for details! :)
>Has anyone got one of these? Are they any good? Are there other
>Perl shirts?
there's a full description of the shirt at the web page. it's a
thick, 100% cotton shirt made by Fruit-of-the-Loom, with a Perl
Mongers Logo (with Camel) silkscreened on the front. right now
i have black t-shirts with a white logo. i've just ordered another
batch of shirts since we've run out of the first batch, so the
wait on actually getting the shirt is going to be a couple of
weeks (sorry :)
Perl Mongers has plans for different t-shirts as well :)
we're currently putting together a deal so we can take credit card
orders over the net, but that's not going to happen within the next
month since i'm gone for June.
[The Camel is a trademark of O'Reilly and Associates and is used
with permission]
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers T-shirts! <URL:http://www.pm.org/tshirts.html>
------------------------------
Date: 28 May 1998 16:54:21 GMT
From: Dave Kenny <dk@tundra.winternet.com>
Subject: Re: Possible to "skip" a record?
Message-Id: <6kk4rt$r2n$2@blackice.winternet.com>
I'm not sure exactly what you need, but perhaps `redo' can help.
It's kind of like next or last. A `redo' restarts the loop block
without evaluating the conditional again. There is an example on
page 103 of the Camel Book. It shows how to append the next line
to the current one (for example if the current line ends in a continuation
mark like "\"). You say $_ = <>; redo; This restarts the loop
just after the while (<>), so you re-examine the now-longer line
that resulted from appending the new line.
coop <jcoop-no-spam@interlog.com> wrote:
: Hi,
: I'm writing a small application that will parse a number of HTML
: files. Files are similar in layout, with minor variations. I am
: looping through the file line by line and grabbing what I want. Is it
: possible, say, when I get to a section where I want to process a
: number of lines, I can skip records and process the line. For
: example:
: while <FILE>
: if (/<TITLE>/) {
: # grab title
: }
: if (/Date/) {
: # grab date
: }
: if (/Address/) {
: # get first line of address
: # go to next line in file and get second line, don't want
: # to say "next" here as it will take me back up to "while" at
: # beginning of program?
: }
: Any suggestions? Thanks in advance.
: Coop
------------------------------
Date: 28 May 98 15:50:27 GMT
From: sitaram@diac.com (Sitaram Chamarty)
Subject: Re: Problem de-referencing a reference to a typeglob stored in a hash
Message-Id: <slrn6mqvtg.kn.sitaram@ltusitaram.diac.com>
On 21 May 1998 13:35:15 GMT, Tom Christiansen <tchrist@mox.perl.com> wrote:
>:the language that's not always intuitive. Do the Perl gods
>:ever regret this tricky overloading of <>?
>
>Oh, yes. Almost as much as indirect object slot parsing.
You mean something like this (from perlobj.pod)?
display {find Critter "Fred"} 'Height', 'Weight';
For our edification (not questioning you) can you explain why this
is bad? Other than for the parser itself, that is. IOW - I'm not
sure if for the beginning programmer it's in the same class as the
<$hash{KEY}> ambiguity.
I am prolly wrong - appreciate knowing where.
Thanks.
Sitaram.
------------------------------
Date: Thu, 28 May 1998 12:21:26 -0400
From: "Mike Dolan" <mdolan@best.com>
Subject: Reading whole file into a scalar
Message-Id: <6kk2u7$3of$1@nntp1.ba.best.com>
I want to read the entire contents of a text file into a single scalar so
that I can apply regular expressions to that scalar. Do you know how to do
this?
TIA,
Mike
------------------------------
Date: 28 May 1998 14:27:46 GMT
From: lindahl@pbm.com (Greg Lindahl)
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <6kjs92$sk0@news1.newsguy.com>
gabor@vmunix.com (Gabor) writes:
> I think this clearly shows the need for a moderated newsgroup. Any
> Perl topics? I guess 'Why NOT crypt?' might qualify.
All of these threads were started by one person. If he didn't
cross-post flames, this wouldn't have happened.
-- g
------------------------------
Date: 28 May 1998 14:16:44 GMT
From: lindahl@pbm.com (Greg Lindahl)
Subject: Re: Tom Christiansen attacks the free software community (was: Re: GNU attacks on the open software community)
Message-Id: <6kjrkc$sk0@news1.newsguy.com>
Evan Kirshenbaum <evan@garrett.hpl.hp.com> writes:
> I suspect that they would give something akin to "not subject to
> government regulation" (Merriam-Webster's definition 4b). I would be
> quite surprised if anybody said that a "free press" implied that a
> purchaser of the _New York Times_ was allowed to recast and republish
> the lead story.
I've never seen anyone say that. What I have seen people say is that
"free press" is a good counter-example which disproves "free always
means no cost" claims, not that "free press" explains "free software".
But hey, given the high level of flame around here, it's no surprise
that people don't read carefully.
-- g
------------------------------
Date: 28 May 1998 16:20:29 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Visibility of "my" vars
Message-Id: <6kk2sd$g80$1@lyra.csx.cam.ac.uk>
Bob Kline <bkline@cortex.nlm.nih.gov> wrote:
>
>The man page for perlsub has the following passage:
>
>"Unlike dynamic variables created by the ``local'' statement, lexical
>variables declared with ``my'' are totally hidden from the outside world,
>including any called subroutines ...."
>
>This would appear to be saying that any called subroutines would not
>be able to see a lexically scoped variable declared/defined at file
>scope, but this does not appear to be matched by the behavior of Perl
>5.004, at least the builds I have been working with:
To be strictly accurate, that quote should have a qualification
" ... including any called subroutines, unless the bodies of those
subroutines are within the scope of the lexical variable, ... "
Mike Guy
------------------------------
Date: Thu, 28 May 1998 16:04:25 GMT
From: jdporter@min.net (John Porter)
Subject: Re: Wanted: info on passing args to functions in perl5
Message-Id: <MPG.fd756e160bcec9896f8@news.min.net>
On 28 May 1998 14:44:16 GMT,
in article <6kjt80$7hl$1@opal.southwind.net>,
karres@southwind.net (Dean Karres) wrote:
>
> the subsequent subroutine call looks like:
>
> filterBillingRecords( $LOGDIR, \$DB_method, \$Tree, \%acpRecord )
>
> the subroutine accepts the parameters as:
>
> my($dir, $DB_method, $Tree, %acpRecord) = @_;
>
> Odd number of elements in hash list at filterBillingRecords.pl line 22.
>
> which is the above "my" line in the subroutine. The book says that this
> message means what it says - there is an odd number of things in the
> hash - which is odd because hashes are paired things...
>
> So, I start looking for the usual suspects. After a lot of head banging
> today I find the the entity called "Tree" above is a reference to a hash
> of it's own. How do I pass a reference to a reference to a hash? Do I
> need to? My barin hurts.
Question is, why do you think you need to pass $DB_method, $Tree, and
%acpRecord by reference? The sub is not expecting them that way, so,
give the sub what it wants:
filterBillingRecords( $LOGDIR, $DB_method, $Tree, %acpRecord )
I.e. take out those backwhacks! That ought to clear things up.
BTW, the hash which was getting an odd number of elements was the
%acpRecord (in the sub's my() list).
Are you executing perl with -w? How about use strict?
hth,
John Porter
------------------------------
Date: Thu, 28 May 1998 11:23:47 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Why does "each" not go thru entire hash??
Message-Id: <356D8183.C217A2CA@matrox.com>
brian d foy wrote:
> >> >Ignore my comments if I'm totally off :-)
>
> >> we can't ignore your comments. they're archived at Deja News. if nobody
> >> stepped in to correct mistakes, others might think you were right.
>
> >What was wrong with what I said?
>
> besides being incorrect, uninformed, and untested?
Thanks for the advice.
By the way, I love the way you trim the messages to prove your point. Did you read what I
had written after that question?
--
Ala Qumsieh | No .. not just another
ASIC Design Engineer | Perl Hacker!!!!!
Matrox Graphics Inc. |
Montreal, Quebec | (Not yet!)
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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". 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 2749
**************************************