[18468] in Perl-Users-Digest
Perl-Users Digest, Issue: 636 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 5 11:05:51 2001
Date: Thu, 5 Apr 2001 08:05:17 -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: <986483116-v10-i636@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 5 Apr 2001 Volume: 10 Number: 636
Today's topics:
7 needed books [Was: Re: Hmmm... Which PERL Book Is Bes lvirden@cas.org
[JOB] Web/Database Programmer/Analyst (US-NY-Ithaca) <rz10@cornell.edu>
Re: array and hash presentation as text (Tad McClellan)
Re: Can module distinguish between "use" and exec invoc (Sweth Chandramouli)
Re: Can module distinguish between "use" and exec invoc <joe+usenet@sunstarsys.com>
Re: Does this newsgroup have an FAQ? <jesse@uchicago.edu>
Hash Referencing question <gtoomey@usa.net>
Re: Hash Referencing question (Bernard El-Hagin)
Re: Hash Referencing question <bmb@ginger.libs.uga.edu>
Re: Hash Referencing question <gtoomey@usa.net>
Re: Help with $variable parsing. <david.kernen@bms.com>
Re: Hmmm... Which PERL Book Is Best Suited For This??? lvirden@cas.org
How can I use a var as part of a regex pattern <joeybach@127.0.0.1>
Re: How can I use a var as part of a regex pattern (Rafael Garcia-Suarez)
Re: How can I use a var as part of a regex pattern <alexis.roda@si.urv.es>
Inserting a line in the middle of a file! <js@hotmail.com>
Re: Inserting a line in the middle of a file! <alexis.roda@si.urv.es>
Re: Inserting a line in the middle of a file! (Tad McClellan)
Multiple header functions <aweiner@cfl.rr.com>
Re: Newbies welcome <camerond@mail.uca.edu>
Re: Newbies welcome (Tad McClellan)
Re: Newbies welcome (Tad McClellan)
Perl Install Problem. James.Cummings@uea.ac.uk
Perl script causing Apache to hang under MS Win 2000 Pr (Mark Warnes)
Re: Please Flame my Benchmark: open vs. cat (Dave Bailey)
Re: Please Help <Waarddebon@chello.nl>
Re: Please Help <josef.moellers@fujitsu-siemens.com>
Regular Expression Help (Easy Question) <magrav@wnt.sas.com>
Re: Regular Expression Help (Easy Question) <alexis.roda@si.urv.es>
Re: Regular Expression Help (Easy Question) (John Joseph Trammell)
Re: Regular Expression Help (Easy Question) (Tad McClellan)
Win32::NetAdmin <tsmith@pathnet.net>
Re: Wrapper To Log Output Of Win32 cmd.exe <simon.andrews@bbsrc.ac.uk>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 5 Apr 2001 14:16:53 GMT
From: lvirden@cas.org
Subject: 7 needed books [Was: Re: Hmmm... Which PERL Book Is Best Suited For This???
Message-Id: <9ahuol$6hj$1@srv38.cas.org>
According to wayne.keenan <wayne.keenan@ntlworld.com>:
:there are 7 books u NEED, 1 & 2 on the list is Programming Perl and the 2nd
:is Object Orientated Perl by Damien Conway,
:without out them, life is a cheese ball.
What are the other 5 books?
--
--
"See, he's not just anyone ... he's my son." Mark Schultz
<URL: mailto:lvirden@cas.org> <URL: http://www.purl.org/NET/lvirden/>
Even if explicitly stated to the contrary, nothing in this posting
------------------------------
Date: Thu, 05 Apr 2001 10:01:40 -0400
From: Ray Zimmerman <rz10@cornell.edu>
Subject: [JOB] Web/Database Programmer/Analyst (US-NY-Ithaca)
Message-Id: <050420011001407870%rz10@cornell.edu>
The Applied Economics & Management department at Cornell University
invites applications for a Web/Database Programmer/Analyst for the
Laboratory for Experimental Economics and Decision Research.
To work in close partnership with team leadership to design & implement
a flexible web-based platform for simulating economic markets. Platform
will be used for a national electric power market experiment, & will
serve as a foundation for many other economics experiments for research
& teaching.
Requirements: Bachelors in computer science or equivalent experience.
Must have experience in design & implementation of large complex
database-driven web applications. Must have 5 yrs experience in
object-oriented Perl programming, SQL database programming & web
programming. Apache/mod_perl & mysql experience desired. Experience
w/embedded Perl technologies, Linux server administration, XML, Java,
JavaScript & open source software a plus.
Full-time employee or on-site contractor options are possible.
For more information on life in the beautiful Ithaca area or employment
at Cornell University, please see the Cornell University Profile at
<http://chronicle.com/jobs/profiles/002711.htm>.
Contact Information:
Ray Zimmerman
Cornell University
428 Phillips Hall
Ithaca NY 14853
Ph: (607) 255-9645
------------------------------
Date: Thu, 5 Apr 2001 10:01:34 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: array and hash presentation as text
Message-Id: <slrn9coulu.ild.tadmc@tadmc26.august.net>
Brad Baxter <bmb@ginger.libs.uga.edu> wrote:
>Brad (I'm not data)
Shoot!
We never get any TV stars hanging out with us here :-(
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 05 Apr 2001 14:18:32 GMT
From: sweth+perl@gwu.edu (Sweth Chandramouli)
Subject: Re: Can module distinguish between "use" and exec invocations?
Message-Id: <Y8%y6.25191$iU.4775483@news1.rdc1.md.home.com>
In article <3acc28e2.8e3$1a2@news.op.net>,
Mark Jason Dominus <mjd@plover.com> wrote:
>In article <%4Ky6.22413$iU.4184631@news1.rdc1.md.home.com>,
>Sweth Chandramouli <sweth+perl@gwu.edu> wrote:
>> This only works from inside a subroutine invoked
>>from outside of the module, though--right?
>
>Right, but a smart guy like you should be able to figure it out from
>this hint.
Well, I haven't been a smart guy since just after FTSD '96,
which explains why I can't see it. Caller would only be relevant from
within a subroutine, if I understand things right, but I'm trying to
make something happen in the module itself when it is loading, before
any subroutines are run from it. A few quick tests seem to confirm
that caller doesn't return anything different between the two invocation
types. Any more explicit hints?
-- Sweth.
--
Sweth Chandramouli ; <sweth+perl@gwu.edu>
------------------------------
Date: 05 Apr 2001 10:34:38 -0400
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: Can module distinguish between "use" and exec invocations?
Message-Id: <m3bsqbtny9.fsf@mumonkan.sunstarsys.com>
sweth+perl@gwu.edu (Sweth Chandramouli) writes:
> In article <3acc28e2.8e3$1a2@news.op.net>,
> Mark Jason Dominus <mjd@plover.com> wrote:
> >In article <%4Ky6.22413$iU.4184631@news1.rdc1.md.home.com>,
> >Sweth Chandramouli <sweth+perl@gwu.edu> wrote:
> >> This only works from inside a subroutine invoked
> >>from outside of the module, though--right?
> >
> >Right, but a smart guy like you should be able to figure it out from
> >this hint.
> Well, I haven't been a smart guy since just after FTSD '96,
> which explains why I can't see it. Caller would only be relevant from
> within a subroutine, if I understand things right, but I'm trying to
> make something happen in the module itself when it is loading, before
> any subroutines are run from it.
And what Perl function should the outside caller use in order to load
your module?
> A few quick tests seem to confirm that caller doesn't return anything
> different between the two invocation types. Any more explicit hints?
Run slower tests, and put the suggested code snippet outside of any
subroutines in your module.
--
Joe Schaefer "The opposite of a correct statement is a false statement. The
opposite of a profound truth may well be another profound
truth."
-- Niels Bohr
------------------------------
Date: Thu, 05 Apr 2001 09:42:29 -0500
From: Jesse James Jensen <jesse@uchicago.edu>
Subject: Re: Does this newsgroup have an FAQ?
Message-Id: <3ACC8455.FC1D5B99@uchicago.edu>
Paul Tomblin wrote:
>
> In a previous article, "pgroves" <pgroves@ntlworld.com> said:
> >If so, how do I get it?
>
> Consider that a mere 4 hours before you posted this question, the
> PerlFAQ Server posted a post with the subject line "FAQ 9.16: How do I
> decode a CGI form?". The word FAQ appears both in the subject line and
> the "name" of the poster, and the post itself contains detailed
> information showing you were you could have found the FAQ both on the web
> and on Usenet.
>
> It appears you're not going to make the minimal effort of scanning a few
> subject lines to find the information for yourself. Read the FAQ. While
> you're at it, you might want to read the FAQ for news.newusers.questions
> for tips on how to make a better first impression.
>
Perhaps the FAQ Server posts should include a direct link (e.g.,
http://www.perl.com/pub/doc/manual/html/pod/perlfaq.html) at the very
top of each message. And also post a generic "Here is the FAQ" message
every so often.
At least this guy didn't just start by asking a FAQ.
------------------------------
Date: Thu, 5 Apr 2001 23:07:55 +1000
From: "Gregory Toomey" <gtoomey@usa.net>
Subject: Hash Referencing question
Message-Id: <OVZy6.9656$45.56457@newsfeeds.bigpond.com>
Hi everybody (again). I find the Perl typing machanism confusing
I've read the "list of hashes" example in perldoc.com, and can reference
element as $var[$i]{hashval}.
Now I want to assign the entire hash to a variable.
Why does the assignment $hash=$var[$i] work, but %hash=$var[$i]
not work?
When I do the $hash=$var[$i], why do I reference elements as
$hash->{hashval} rather than $hash{hashval}?
Gregory Toomey
------------------------------
Date: Thu, 5 Apr 2001 13:17:18 +0000 (UTC)
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: Hash Referencing question
Message-Id: <slrn9cos1c.g7s.bernard.el-hagin@gdndev32.lido-tech>
On Thu, 5 Apr 2001 23:07:55 +1000, Gregory Toomey <gtoomey@usa.net> wrote:
>Hi everybody (again). I find the Perl typing machanism confusing
>
>I've read the "list of hashes" example in perldoc.com, and can reference
>element as $var[$i]{hashval}.
>Now I want to assign the entire hash to a variable.
>
>Why does the assignment $hash=$var[$i] work, but %hash=$var[$i]
>not work?
$var[$i] is not a hash, but a hash reference, which, in fact, is a
scalar. In the first case you're assigning a scalar to a scalar so
everything is fine. In the second case you're doing something analogous
to:
%hash = 5;
which is silly.
>When I do the $hash=$var[$i], why do I reference elements as
>$hash->{hashval} rather than $hash{hashval}?
Again, because $var[$i] is a reference to a hash, not a hash. You need
to dereference the reference and the -> operator is what tells the
interpreter to do that.
More info:
perldoc perlref
perldoc perldsc
perldoc perlreftut
Cheers,
Bernard
--
#requires 5.6.0
perl -le'* = =[[`JAPH`]=>[q[Just another Perl hacker,]]];print @ { @ = [$ ?] }'
------------------------------
Date: Thu, 5 Apr 2001 09:31:13 -0400
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: Hash Referencing question
Message-Id: <Pine.A41.4.21.0104050917180.16576-100000@ginger.libs.uga.edu>
On Thu, 5 Apr 2001, Gregory Toomey wrote:
> Hi everybody (again). I find the Perl typing machanism confusing
It can be that.
> I've read the "list of hashes" example in perldoc.com, and can reference
> element as $var[$i]{hashval}.
> Now I want to assign the entire hash to a variable.
>
> Why does the assignment $hash=$var[$i] work, but %hash=$var[$i]
> not work?
See line 16 below. You have to dereference the reference.
> When I do the $hash=$var[$i], why do I reference elements as
> $hash->{hashval} rather than $hash{hashval}?
Because $hash is a reference to a hash. See also line 14.
In "$hash{hashval}" the "$hash" part is NOT talking about the scalar
$hash, rather it is talking about one element of the hash %hash.
1 #!/usr/local/bin/perl -l
2 use warnings;
3 use strict;
4
5 my @var = ( { hashval => "Hey" } );
6
7 my $i = 0;
8
9 print $var[$i]{hashval};
10
11 my $hash=$var[$i];
12
13 print $hash->{hashval};
14 print $$hash{hashval};
15
16 my %hash=%{$var[$i]};
17
18 print $hash{hashval};
Less confusing? :-)
Brad
------------------------------
Date: Fri, 6 Apr 2001 00:34:33 +1000
From: "Gregory Toomey" <gtoomey@usa.net>
Subject: Re: Hash Referencing question
Message-Id: <%a%y6.9884$45.55596@newsfeeds.bigpond.com>
Thanks guys. I've always found referencing/dereferencing confusing.
Mabe I need a strongly typed language like ML.
Gregory Toomey
------------------------------
Date: Thu, 05 Apr 2001 10:17:34 -0400
From: Dave <david.kernen@bms.com>
Subject: Re: Help with $variable parsing.
Message-Id: <3ACC7E7D.72C4DAF9@bms.com>
Server1 wrote:
> Greeting all,
> I am currently working on a project that will read in perl source code
> and I need help. what I need the script to do is:
>
> 3) display the variable name. (NOT the value.) e.g.: If found, the variable
> $variable would display "$variable" without quotes.
>
> ...
> print "I've spotted the variable: $findvariable\n";
> }
> }
>
Is this an April Fool's joke? Not even a Perl newbie would ask this...
------------------------------
Date: 5 Apr 2001 14:25:51 GMT
From: lvirden@cas.org
Subject: Re: Hmmm... Which PERL Book Is Best Suited For This???
Message-Id: <9ahv9f$lpd$1@srv38.cas.org>
According to Uri Guttman <uri@sysarch.com>:
:only the online perl docs (over 1100
:pages) are the complete reference.
If the online perl docs were a 'complete reference' then there probably
would be no need for the Camel book...
--
--
"See, he's not just anyone ... he's my son." Mark Schultz
<URL: mailto:lvirden@cas.org> <URL: http://www.purl.org/NET/lvirden/>
Even if explicitly stated to the contrary, nothing in this posting
------------------------------
Date: Thu, 05 Apr 2001 14:29:00 GMT
From: "John Doe" <joeybach@127.0.0.1>
Subject: How can I use a var as part of a regex pattern
Message-Id: <Mi%y6.34542$z4.6682441@typhoon.tampabay.rr.com>
What I need to do is match a number of strings within a string . The code
I have subs the querry to the what I believe is the right syntax (it works with hard coded
values). But how can I use a variable as my matching pattern.
Like $string = "/line/im && /sep/im"
if ($_ =~ m$string){print}
The actual code I am using is :
#!/usr/bin/perl
open (TEST, "<cisco.log");
my $string = (<STDIN>);
chomp $string;
$string =~ s/ /\/im \&\& \//g;
print "/$string/im\n";
while (<TEST>){
if ($_ =~ m/\Q$string\e/im){
print "$_\n";
}
}
------------------------------
Date: Thu, 05 Apr 2001 14:38:36 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: How can I use a var as part of a regex pattern
Message-Id: <slrn9cp0s4.len.rgarciasuarez@rafael.kazibao.net>
John Doe wrote in comp.lang.perl.misc:
> What I need to do is match a number of strings within a string . The code
> I have subs the querry to the what I believe is the right syntax (it works with hard coded
> values). But how can I use a variable as my matching pattern.
> Like $string = "/line/im && /sep/im"
If you want to embed Perl code in strings, then you should look at the
eval() function.
--
Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/
------------------------------
Date: Thu, 05 Apr 2001 16:55:22 +0200
From: Alexis Roda <alexis.roda@si.urv.es>
Subject: Re: How can I use a var as part of a regex pattern
Message-Id: <3ACC875A.5C5561AE@si.urv.es>
John Doe wrote:
>
> What I need to do is match a number of strings within a string . The code
> I have subs the querry to the what I believe is the right syntax (it works with hard coded
> values). But how can I use a variable as my matching pattern.
> Like $string = "/line/im && /sep/im"
> if ($_ =~ m$string){print}
>
> The actual code I am using is :
>
> #!/usr/bin/perl
> open (TEST, "<cisco.log");
> my $string = (<STDIN>);
> chomp $string;
> $string =~ s/ /\/im \&\& \//g;
> print "/$string/im\n";
>
> while (<TEST>){
> if ($_ =~ m/\Q$string\e/im){
> print "$_\n";
>
> }
> }
If I understand correctly what you try to do is transform $string to
something like:
'value1/im && /value2'
so that you'll get two patterns /\Qvalue1/im && /value2\E/im. This will
not work, use an eval instead or a loop to match every pattern in
$string.
HTH
--
////
(@ @)
---------------------------oOO----(_)----OOo------------------------
Los pecados de los tres mundos desapareceran conmigo.
Alexis Roda - Universitat Rovira i Virgili - Reus, Tarragona (Spain)
--------------------------------------------------------------------
------------------------------
Date: Thu, 05 Apr 2001 14:09:23 GMT
From: "Kenneth Eide" <js@hotmail.com>
Subject: Inserting a line in the middle of a file!
Message-Id: <n0%y6.1608$CO5.245241@news01.chello.no>
Hello comp.lang.perl.misc!!
My first time using this message board, and it looks good.
--
I have a template file wich looks like this:
#####################################
# Name # #
# Age # #
# City # #
#####################################
What would be the most efficient way of filling a template like this?
I allready did it with format, but I wanted to see if it could be done
another way.
Some of my ideas are:
Create a Variable wich holds the whole line, like:
# Name # John Smith #
and replace (or delete and insert) this at line 2 in my template?
Insert the $name on line 2, col 13. And remove spaces behind it so the last
# isn't moved?
OR this way wich i'm using now, but then the temlate looks like this wich is
not really what i want (i want it to look like the one in the top of this
post):
# Name # -Name
# Age # -Age
Here i just do a: s/-Name/$name/ and a s/-Age/$age/ and print the "#"
on after by using
print " " x 50 - length $name (sorry if this isn't the right syntax, or
right amount of blank spaces, but i can't access my shell where my script is
now).
Anyway.. my primary goal is to make the template file looks like the on at
the top.
And filling it efficiently, without loading the whole file into memory, and
without too much confusing code.
Thanks!!
Kai Pettersen
------------------------------
Date: Thu, 05 Apr 2001 16:28:05 +0200
From: Alexis Roda <alexis.roda@si.urv.es>
Subject: Re: Inserting a line in the middle of a file!
Message-Id: <3ACC80F5.FD057388@si.urv.es>
Kenneth Eide wrote:
>
> Hello comp.lang.perl.misc!!
>
> My first time using this message board, and it looks good.
> --
> I have a template file wich looks like this:
>
> #####################################
> # Name # #
> # Age # #
> # City # #
> #####################################
>
> What would be the most efficient way of filling a template like this?
> I allready did it with format, but I wanted to see if it could be done
> another way.
A nice way, but not the more efficient:
$line = sprintf("# Name # %-50s #", $name);
...
adjust the format string according to your needs. Another way, more
efficient, may be:
$padding = " " x 50;
$line1 = substr(" # Name # $name$padding", 0, 50) . "#";
$line2 = substr(" # Age # $age$padding", 0, 50) . "#";
...
HTH
--
////
(@ @)
---------------------------oOO----(_)----OOo------------------------
Los pecados de los tres mundos desapareceran conmigo.
Alexis Roda - Universitat Rovira i Virgili - Reus, Tarragona (Spain)
--------------------------------------------------------------------
------------------------------
Date: Thu, 5 Apr 2001 10:05:13 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Inserting a line in the middle of a file!
Message-Id: <slrn9cousp.ild.tadmc@tadmc26.august.net>
Kenneth Eide <js@hotmail.com> wrote:
>Hello comp.lang.perl.misc!!
Hi.
>My first time using this message board, and it looks good.
This is not a "message board" (BBS).
This is a Usenet newsgroup.
It is an important distinction, as there are different rules of society.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 05 Apr 2001 14:37:52 GMT
From: "AW" <aweiner@cfl.rr.com>
Subject: Multiple header functions
Message-Id: <4r%y6.34549$z4.6687042@typhoon.tampabay.rr.com>
I have a HTML page with a submission form that will POST to a cgi script.
The script will then set the proper header for a file download. The file is
then downloaded.
Problem:
After the file downloads I would like to print to the screen (thanks for
downloading, removing the submission form or the like). Short of that, I
would accept redirecting to a different url. Since the header was written
for "Content-type: application/pdf" I cannot print to the screen or
redirect.
Do you have a solution?
Application code:
if ($some_test)
print "Content-type: application/pdf; name=$filename\n";
print "Content-Disposition: attachment; filename=$filename\n\n";
open(OUTFILE, "$filename");
while (<OUTFILE>) {
print $_;
}
}
How can I now print to the screen or do a redirect?
------------------------------
Date: Thu, 05 Apr 2001 08:53:46 -0500
From: Cameron Dorey <camerond@mail.uca.edu>
Subject: Re: Newbies welcome
Message-Id: <3ACC78EA.FEC915BA@mail.uca.edu>
Bernard El-Hagin wrote:
>
> On Thu, 05 Apr 2001 07:38:58 -0500, Cameron Dorey <camerond@mail.uca.edu> wrote:
> >Bernard El-Hagin wrote:
> >>
> >> On Thu, 05 Apr 2001 10:57:47 GMT, Gwyn Judd <tjla@guvfybir.qlaqaf.bet> wrote:
> >> >I was shocked! How could Logan Shaw <logan@cs.utexas.edu>
> >> >say such a terrible thing:
> >> >>In article <MqXy6.2$8J2.1187@vic.nntp.telstra.net>,
> >> >>Wyzelli <wyzelli@yahoo.com> wrote:
> >> >>>
> >> >>>I'd like to see you cut down a Californian Redwod using a banana.
> >> >>
> >> >
> >> >You just lack the imagination required to perform the job. I would
> >> >electrically charge the frozen banana and then accelerate it to near
> >> >lightspeed in a particle accelerator which was aimed at the base of the
> >> >tree. A few passes and the trunk of the tree will separate from the
> >> >roots. Simple.
> >>
> >> Aren't you, at this point, cutting down a California Redwood using a
> >> banana *and* a particle accelerator?
> >
> >Actually, he didn't say "using _only_ a banana." I'd use the banana as
> >an energy source (for me) before I picked up an appropriately-sized
> >chain saw to finish the job (preparation is here a very important step).
>
> Why would you need a chainsaw when you've got a banana? Chemistry
> professors. Sheesh!
I need _something_ to pound the banana into the tree trunk with before I
start it up.
Cameron
--
Cameron Dorey
Associate Professor of Chemistry
University of Central Arkansas
Phone: 501-450-5938
camerond@mail.uca.edu
------------------------------
Date: Thu, 5 Apr 2001 08:57:10 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Newbies welcome
Message-Id: <slrn9coqt6.if7.tadmc@tadmc26.august.net>
Bernard El-Hagin <bernard.el-hagin@lido-tech.net> wrote:
>On Thu, 05 Apr 2001 10:57:47 GMT, Gwyn Judd <tjla@guvfybir.qlaqaf.bet> wrote:
>>I was shocked! How could Logan Shaw <logan@cs.utexas.edu>
>>say such a terrible thing:
>>>In article <MqXy6.2$8J2.1187@vic.nntp.telstra.net>,
>>>Wyzelli <wyzelli@yahoo.com> wrote:
>>>>"A_Geekette" <moiraine{NOSPAM}@qwest.net> wrote in message
>>>>news:3ACB0843.24346AEE@qwest.net...
>>>>>
>>>>> "Nothing is impossible, no matter how improbable."
>>>>> -Anonymous
>>>>
>>>>I'd like to see you cut down a Californian Redwod using a banana.
^^^^^^
I didn't know that those tofu eaters used smokeless tobacco.
<grin>
And I thought the Standard Test used a herring anyway, not a banana.
>>I would
>>electrically charge the frozen banana and then accelerate it to near
>>lightspeed in a particle accelerator which was aimed at the base of the
>>tree.
>Aren't you, at this point, cutting down a California Redwood using a
>banana *and* a particle accelerator?
Yes. And that _would_ be "using a banana", as specified by that guy
with all those letters from the end of the alphabet in his name.
Incomplete specifications (seems to be missing an "only" somewhere)
can lead to unsatisfactory implementations, learn to live with it :-)
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 5 Apr 2001 09:53:40 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Newbies welcome
Message-Id: <slrn9cou74.ild.tadmc@tadmc26.august.net>
Bernard El-Hagin <bernard.el-hagin@lido-tech.net> wrote:
>Why would you need a chainsaw when you've got a banana?
Maybe he does not have a banana.
Could be he's just happy to see us.
<ducking...>
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 5 Apr 2001 14:09:34 GMT
From: James.Cummings@uea.ac.uk
Subject: Perl Install Problem.
Message-Id: <9ahuau$75o$1@cpca14.uea.ac.uk>
In trying to install perl-5.6.0 on a mac OS X (bsd-like rhapsody/darwin)
I end up having a problem at the end of making it, when it says:
/usr/bin/libtool: internal link edit command failed
make: *** [libperl.dylib] Error 1
I'm sure it is something obvious, but it isn't to me, so any suggestions out
there?
Thanks,
James
--
James Cummings | james@cursus.uea.ac.uk | http://www.cursus.uea.ac.uk/~james
CURSUS Project, School of Music, University of East Anglia,
Norwich, Norfolk, NR4 7TJ,UK
------------------------------
Date: Thu, 05 Apr 2001 14:43:57 GMT
From: mark.warnes@limecs.com (Mark Warnes)
Subject: Perl script causing Apache to hang under MS Win 2000 Pro
Message-Id: <3acc838d.25519578@news.firstnet.co.uk>
I have a perl script that I have run successfully using Apache 1.13.17
with mod_perl 1.24 on a Window 95 machine.
Having just installed everything on a Windows 2000 Professional
machine, when I call the script through my browser, the browser just
sits waiting for a reply for eternity. What's more, when I stop the
Apache service to reset everything, it takes an age.
I have ActiveState build 620 on the Win 2000 box.
Has anyone else come across this problem and are there any
solutions/suggestions as to what to do?
Thanks,
Mark
------------------------------
Date: 05 Apr 2001 13:56:09 GMT
From: dave@sydney.daveb.net (Dave Bailey)
Subject: Re: Please Flame my Benchmark: open vs. cat
Message-Id: <slrn9cok2j.ee5.dave@sydney.daveb.net>
On Thu, 5 Apr 2001 12:22:03 +0000 (UTC), Abigail <abigail@foad.org> wrote:
>Dave Bailey (dave@sydney.daveb.net) wrote on MMDCCLXXIII September
>MCMXCIII in <URL:news:slrn9cmlmt.a0d.dave@sydney.daveb.net>:
[...]
>,, Yes, but after 10,000 reads, we finally see that the difference between
>,, the two methods is essentially the time required for a fork() - which,
>,, apparently, would be a novel concept to the original poster's coworkers.
>
>But that time is totally irrelevant, as it is dwarved by the disc access
>time. Which was factored out. The benchmark suggest that open() is much
>faster then `cat`. But it isn't, as the difference is nothing compared
>to the disk access.
You've made this claim several times but have provided no evidence
to back it up. In fact, reading an uncached 10 KB file is still twice
as fast as backticking cat to read an uncached 10 KB file. Is that
difference "nothing compared to the disk access"?
>,, Since that is the essence of their misunderstanding, I feel that the
>,, benchmark is appropriate and sufficient to settle the disagreement.
[...]
>The fault lies with *both* parties, thinking the time difference matters.
>It doesn't.
Who said they thought the time difference was significant? Perhaps
they were merely curious about it.
[...]
>,, >Any program that does the same operation repeatedly in an inner
>,, >loop has something that can be optimized away.
>,,
>,, I'd love to see you "optimize" the Gauss-Jordan elimination algorithm in
>,, this manner. See, for example, "Numerical Recipes in C", 2nd ed., p. 39
>,, (near the bottom of the page) for a precise example of precomputation of
>,, a reciprocal to speed up loop processing:
>
>Eh, which statement do you mean? As far as I can see, all statements
>in inner loops depend directly or indirectly on the variant of the most
>inner enclosing loop. And hence, they are not the same operation.
When a loop includes a division of something by something else which is
computed outside of the loop, it can be optimized by computing the
reciprocal of the invariant quantity and multiplying by that inside
the loop. It doesn't matter that a different value is multiplied by
the invariant quantity each loop iteration. Since multiplication is
faster than division, the loop finishes more quickly. You tried to
refute my point by sidestepping it and arguing that the multiplication
could be "optimized away". This is not correct. You must have
misunderstood me.
pivinv=1.0/a[icol][icol];
for (l=1;l<=n;l++) a[icol][l] *= pivinv;
Do you see how computing pivinv makes the loop faster?
--
Dave Bailey
davidb54@yahoo.com
------------------------------
Date: Thu, 05 Apr 2001 13:16:40 GMT
From: "Waarddebon" <Waarddebon@chello.nl>
Subject: Re: Please Help
Message-Id: <Ye_y6.236612$j_4.3122808@Flipper>
Thanks people, I figured it out myself... >
Waarddebon <Waarddebon@chello.nl> schreef in berichtnieuws
1PYy6.234312$j_4.3099564@Flipper...
> Why doesn't this work ?
>
> $remote2="today";
> open (THEFILE,"/data1/hm/makers/bezoekers/$remote2");
> print THEFILE "hi";
> close THEFILE;
>
>
------------------------------
Date: Thu, 05 Apr 2001 16:52:58 +0200
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: Please Help
Message-Id: <3ACC86CA.6822E15B@fujitsu-siemens.com>
Waarddebon wrote:
> =
> Thanks people, I figured it out myself... >
^ small clue?
> =
> Waarddebon <Waarddebon@chello.nl> schreef in berichtnieuws
> 1PYy6.234312$j_4.3099564@Flipper...
> > Why doesn't this work ?
> >
> > $remote2=3D"today";
> > open (THEFILE,"/data1/hm/makers/bezoekers/$remote2");
> > print THEFILE "hi";
> > close THEFILE;
I guess, I know what you did wrong, but how about telling what you
changed, so people who read your initial posting and though "gee, I had
the same problem once and never quite figured out why it didn't work"
can become enlightened.
-- =
Josef M=F6llers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize
-- T. Pratchett
------------------------------
Date: Thu, 05 Apr 2001 09:51:48 -0400
From: Max Gravitt <magrav@wnt.sas.com>
Subject: Regular Expression Help (Easy Question)
Message-Id: <metoctkio74plmor29069gfftn493l4rkj@4ax.com>
I'm trying to create a RE that matches numbers 55-99. My first
thought was to do [55-99], but that doesn't work. Evidently, if you
use a range, you can only specify single digits. "[5-9][0-9]" almost
works, except it allows for values 50-54, which I don't want to match.
I'm using gnu.regexp java package, which emulates Perl5 regular
expressions.
------------------------------
Date: Thu, 05 Apr 2001 16:31:43 +0200
From: Alexis Roda <alexis.roda@si.urv.es>
Subject: Re: Regular Expression Help (Easy Question)
Message-Id: <3ACC81CF.AADAB6B4@si.urv.es>
Max Gravitt wrote:
>
> I'm trying to create a RE that matches numbers 55-99. My first
> thought was to do [55-99], but that doesn't work. Evidently, if you
> use a range, you can only specify single digits. "[5-9][0-9]" almost
> works, except it allows for values 50-54, which I don't want to match.
Try something like:
([6-9][0-9])|(5[5-9])
the first one matches numbers 60-99 and the second 55-59.
HTH
--
////
(@ @)
---------------------------oOO----(_)----OOo------------------------
Los pecados de los tres mundos desapareceran conmigo.
Alexis Roda - Universitat Rovira i Virgili - Reus, Tarragona (Spain)
--------------------------------------------------------------------
------------------------------
Date: Thu, 05 Apr 2001 14:32:44 GMT
From: trammell@bayazid.hypersloth.invalid (John Joseph Trammell)
Subject: Re: Regular Expression Help (Easy Question)
Message-Id: <slrn9coueg.h2v.trammell@bayazid.hypersloth.net>
On Thu, 05 Apr 2001 09:51:48 -0400, Max Gravitt <magrav@wnt.sas.com> wrote:
> I'm trying to create a RE that matches numbers 55-99. My first
> thought was to do [55-99], but that doesn't work. Evidently, if you
> use a range, you can only specify single digits. "[5-9][0-9]" almost
> works, except it allows for values 50-54, which I don't want to match.
>
> I'm using gnu.regexp java package, which emulates Perl5 regular
> expressions.
Lessee...
/5[5-9]|[6-9][0-9]/; # 55-59 or 60-99
------------------------------
Date: Thu, 5 Apr 2001 10:00:06 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Regular Expression Help (Easy Question)
Message-Id: <slrn9couj6.ild.tadmc@tadmc26.august.net>
Max Gravitt <magrav@wnt.sas.com> wrote:
>I'm trying to create a RE that matches numbers
You are using the wrong tool.
Patterns are for working with _strings_.
Perl's numerical operators are for working with numbers.
>55-99. My first
>thought was to do [55-99], but that doesn't work.
It is equivalent to [56789], and matches a _single_ character, as
do *all* character classes.
>Evidently, if you
>use a range, you can only specify single digits.
It is the char class, not the range, that imposes the "single character"
restriction. If you want more than one such character, you modify
the char class with a following quantifier.
>"[5-9][0-9]" almost
>works, except it allows for values 50-54, which I don't want to match.
>
>I'm using gnu.regexp java package, which emulates Perl5 regular
>expressions.
Use arithmetic on numbers, use patterns on strings.
if ( $num >= 55 and $num <= 99 ) {
# do stuff
}
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 05 Apr 2001 13:14:13 GMT
From: "Tony Smith" <tsmith@pathnet.net>
Subject: Win32::NetAdmin
Message-Id: <Fc_y6.105$MN2.43990@dfiatx1-snr1.gtei.net>
Does the UserGetAttribute function in Win32::NetAdmin "have" to be run on
a PDC?
If I run it on my machine, I get:
"The system could not find the environment option that was entered"
I havent tried running it on the pdc.....
script:
use Win32::NetAdmin;
Win32::NetAdmin::UserGetAttributes("PDC",
"username", $password, $passwordage,
$privilege, $homedir, $comment,
$flags, $scriptpath) or die "$^E";
Thanks
------------------------------
Date: Thu, 05 Apr 2001 15:56:21 +0100
From: Simon Andrews <simon.andrews@bbsrc.ac.uk>
Subject: Re: Wrapper To Log Output Of Win32 cmd.exe
Message-Id: <3ACC8795.B5DD97DF@bbsrc.ac.uk>
Josh Geller wrote:
>
> Folks,
>
> I have a perl script which runs fine when called under the WINNT
> cmd.exe.
>
> I want to snag the output of this and write it to a file.
>
> To this end, I have written a tiny perl script which goes like this:
Why not just open a Command Prompt and do
perl myscript.pl > log.file
WinNT has redirection too you know ....
------------------------------
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 V10 Issue 636
**************************************