[25136] in Perl-Users-Digest
Perl-Users Digest, Issue: 7385 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 9 14:05:32 2004
Date: Tue, 9 Nov 2004 11:05:06 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 9 Nov 2004 Volume: 10 Number: 7385
Today's topics:
Re: 'stat' and it's exceptions <nobull@mail.com>
Re: Binary files in PERL? <flavell@ph.gla.ac.uk>
Core dump while calling external commands using system( (Sachin)
Error received opening file (Mortgageloan2004)
Re: Error received opening file <mritty@gmail.com>
Re: Error received opening file <jwillmore@fastmail.us>
Re: Error received opening file <jwillmore@fastmail.us>
Re: Error received opening file <tintin@invalid.invalid>
Re: extracting the super classes of an object from the (Anno Siegel)
FAQ 8.22: Why do setuid perl scripts complain about ker <comdog@panix.com>
Re: Firefox broswer staring Perl CGI <postmaster@castleamber.com>
Re: Firefox broswer staring Perl CGI <postmaster@castleamber.com>
Re: matching all perldoc names but no more <flavell@ph.gla.ac.uk>
Re: matching all perldoc names but no more <ioneabu@yahoo.com>
Re: matching all perldoc names but no more <flavell@ph.gla.ac.uk>
perldoc mirror? (Matt C)
Re: perldoc mirror? <mritty@gmail.com>
Re: sub refs in qq strings <postmaster@castleamber.com>
Re: why is pattern matching using '|' slower than 2 sep <jwillmore@fastmail.us>
Re: why is pattern matching using '|' slower than 2 sep <jwillmore@fastmail.us>
Re: why is pattern matching using '|' slower than 2 sep <jwillmore@fastmail.us>
Re: why is pattern matching using '|' slower than 2 sep (Anno Siegel)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 09 Nov 2004 18:57:23 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: 'stat' and it's exceptions
Message-Id: <cmr3uj$src$1@slavica.ukpost.com>
Fred aka.... Fred wrote:
>
> grep(!/^\.{1,2}$/, readdir(DIR))
>
> and no faq refs please, I KNOW it's in the faqs (?), I just want some
> help here. If that honesty isn't good enought then I don't qualify.
So you are an honest freeloader?
> I know the grep loads everything. Now coming from a Unix BG I figure
> those {1,2}$/, references might be changed to
> grep a pattern of $pattern..... but the stuff I don't know is
>
>
> 1. How to expand the var in that context.
Perl regex interpolate variables in the same way as double quoted
strings. Thus the match the pattern in $pattern you'd say /$pattern/.
> 2. What 1,2 mean (please don't tell me RTFM.. I ready got code
> running, just want to understand perl.)
Why no tell you to RTFM? In what way do you suppose it is better for us
to read the manual to you. Reading manuals is a good way to gain
understanding. BTW you should be looking foe what {...} does in regex
(see perlre).
------------------------------
Date: Tue, 9 Nov 2004 17:02:18 +0000
From: "Alan J. Flavell" <flavell@ph.gla.ac.uk>
Subject: Re: Binary files in PERL?
Message-Id: <Pine.LNX.4.61.0411091657010.19030@ppepc56.ph.gla.ac.uk>
On Mon, 8 Nov 2004, Ben Morrow wrote:
> binmode will always give you a binary file, and should *always* be
> used for one.
Good advice.
It might be worth stressing that the documentation for some older
versions of Perl contains some remarks from Unix bigots which seem to
imply that only the users of brain-dead operating systems should be
using binmode(). Ignore them, and get some more-recent documentation.
> Not doing so will lead to perl attempting to interpret the
> contents of the file as (probably) ISO8859-1, and treat these as
> characters, which may have strange effects if you later start using
> Unicode.
Indeed. And of course it also makes software less portable to other
platforms - even in those older Perl versions. Which might be what
the unix bigots were hoping - but that's hardly to be commended, in a
language like Perl which aims to be rather platform-neutral.
------------------------------
Date: 9 Nov 2004 08:18:24 -0800
From: Sachinjee@gmail.com (Sachin)
Subject: Core dump while calling external commands using system()
Message-Id: <298ab743.0411090818.437aa85c@posting.google.com>
All,
I have a perl script using system() to call external Shell and Perl
scripts.
The Scripts runs good most of the times and created core dump with
return code of "returned 0x8b: caught signal 11 with coredump"
It is difficult to re-create the core; so I am running a never ending
loop to get the failues. The last core dump I got was only after 1200
successful runs.
I am using listed perl and associated modules:
Perl :5.6.1
DBI :1.43
DBD :1:15
OS : Solaris 2.8, (108528-23)
Action Taken : I have installed a new version of perl (5.8.5) with DBI
and DBD still have same issues.
....
Evry time I run gdb the last few lines are :
Loaded symbols for /lib/libkstat.so.1
Reading symbols from /lib/libthread.so.1...done.
Loaded symbols for /lib/libthread.so.1
#0 0xfefaa064 in _disp () from /lib/libthread.so.1
(gdb)
---------------
$ mdb core.run_process.pl.18398
Loading modules: [ ]
> $r
%g0 = 0x00000000 %l0 = 0xfefd7844
libthread.so.1`_dqactmap
%g1 = 0x00000020 %l1 = 0x0000000c
%g2 = 0x00000000 %l2 = 0xfefd7850
libthread.so.1`_dqactmap+0xc
%g3 = 0x00000000 %l3 = 0x00000003
%g4 = 0x00000000 %l4 = 0x0000001f
%g5 = 0x00000000 %l5 = 0x00000000
%g6 = 0x00000000 %l6 = 0x00000000
%g7 = 0xfef75d98 %l7 = 0xfefccd38
libthread.so.1`_nrunnable
%o0 = 0x00000020 %i0 = 0x00000000
%o1 = 0x00000000 %i1 = 0xfefccd3c
libthread.so.1`_maxpriq
%o2 = 0x00000000 %i2 = 0xfefcc000
%o3 = 0x000003f8 %i3 = 0xfefd8d04
libthread.so.1`_dispq
%o4 = 0x00008000 %i4 = 0x00000060
%o5 = 0x0000007f %i5 = 0x00000000
%o6 = 0xfef75b48 %i6 = 0xfef75ba8
%o7 = 0xfefd90fc libthread.so.1`_dispq+0x3f8 %i7 = 0xfefa8b8c
libthread.so.1`_qswtch+0x5c
%psr = 0xfe000000 impl=0xf ver=0xe icc=nzvc
ec=0 ef=0 pil=0 s=0 ps=0 et=0 cwp=0x0
%y = 0xff3e91f0
%pc = 0xfefaa064 libthread.so.1`_disp+0x88
%npc = 0xfefaa068 libthread.so.1`_disp+0x8c
%sp = 0xfef75b48
%fp = 0xfef75ba8
%wim = 0x00000000
%tbr = 0x00000000
>
Any help will be of great help.
Thanks
------------------------------
Date: 09 Nov 2004 16:17:59 GMT
From: mortgageloan2004@aol.com (Mortgageloan2004)
Subject: Error received opening file
Message-Id: <20041109111759.07592.00000384@mb-m01.aol.com>
I get an error every time I run this. I need to customize a html form by
reading in the form, and printing it right back out to a newfile line by line.
When it gets to line 1702 it adds a new line. THe contents of the value field
need to be a variable in another script which I should be able to grab if I
write this as a subroutine. I get a 500 error every time I run this.
#!/usr/bin/perl
$b = "loanappnew";
$I=0;
open(IN,"../pwc/loanapp.htm") || die "cannot open loanapp.htm for reading: $!";
open(OUT,">$b") || die "cannot create $b: $!";
while (<IN>) { #read a line from file $a into $_
print OUT $_; #print that line to file $b
if ($I=1702) {
print OUT "<INPUT TYPE='hidden' NAME='subject' VALUE='test>";
}
$I++;
}
close(IN);
close(OUT);
------------------------------
Date: Tue, 09 Nov 2004 16:34:21 GMT
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: Error received opening file
Message-Id: <hk6kd.354$uT1.303@trndny03>
"Mortgageloan2004" <mortgageloan2004@aol.com> wrote in message
news:20041109111759.07592.00000384@mb-m01.aol.com...
> I get an error every time I run this. I need to customize a html form
by
> reading in the form, and printing it right back out to a newfile line
by line.
> When it gets to line 1702 it adds a new line. THe contents of the
value field
> need to be a variable in another script which I should be able to grab
if I
> write this as a subroutine. I get a 500 error every time I run this.
"a 500 error" is not a suitable error description. All "a 500 error"
tells you is "something went wrong". Have you read
perldoc -q 500
?
If not, please do so, and follow the advice in that document. If you
still recieve the error, examine your server logs to find out what the
actual error message is. You could also consider adding the lines:
use CGI::Carp qw/fatalsToBrowser warningsToBrowser/;
warningsToBrowser(1);
to the top of your script to cause the compilation errors and warnings
to be printed to your browser as well as the error logs.
Paul Lalli
P.S. See below for a possible problem.
>
> #!/usr/bin/perl
> $b = "loanappnew";
> $I=0;
> open(IN,"../pwc/loanapp.htm") || die "cannot open loanapp.htm for
reading: $!";
> open(OUT,">$b") || die "cannot create $b: $!";
> while (<IN>) { #read a line from file $a into $_
$a? What's $a? This comment is nonsensical.
> print OUT $_; #print that line to file $b
> if ($I=1702) {
I'm going to take a while guess you don't mean this.
> print OUT "<INPUT TYPE='hidden' NAME='subject' VALUE='test>";
> }
> $I++;
> }
> close(IN);
> close(OUT);
------------------------------
Date: Tue, 09 Nov 2004 11:42:15 -0500
From: James Willmore <jwillmore@fastmail.us>
Subject: Re: Error received opening file
Message-Id: <pan.2004.11.09.16.42.12.688186@fastmail.us>
On Tue, 09 Nov 2004 16:17:59 +0000, Mortgageloan2004 wrote:
Some comments ....
> #!/usr/bin/perl
#!/usr/bin/perl -T
#enable taint checking if this is a CGI script
use strict;
use warnings;
> $b = "loanappnew";
#single quotes used
my $b = 'loanappnew';
> $I=0;
no need for this variable ... read on ...
> open(IN,"../pwc/loanapp.htm") || die "cannot open loanapp.htm for reading: $!";
#notice I'm using single quotes ...
#no interpolation performed with single quotes
open IN, '../pwc/loanapp.htm'
or die "cannot open loanapp.htm for reading: $!";
> open(OUT,">$b") || die "cannot create $b: $!";
#need interpolation here (because of $b)
open OUT,">$b"
or die "cannot create $b: $!";
> while (<IN>) { #read a line from file $a into $_
> print OUT $_; #print that line to file $b
> if ($I=1702) {
#use $. to determine what line you're at in IN
if ($. == 1702) {
> print OUT "<INPUT TYPE='hidden' NAME='subject' VALUE='test>";
#again, single quotes
print OUT '<INPUT TYPE="hidden" NAME="subject" VALUE="test">';
> }
> $I++;
#no need for $I ...
> }
> close(IN);
> close(OUT);
close IN;
close OUT;
Now ... we've reached the end of the script and no HTTP header has been
issued by the script ... which appears to me the main reason for the '500'
server error you're getting.
Start reading some tutorials on writting Perl CGI scripts :-) Or, take a
look at the CGI module. You don't *have* to use it, but it does give some
directions on what the structure of a CGI script is.
HTH
Jim
------------------------------
Date: Tue, 09 Nov 2004 11:45:08 -0500
From: James Willmore <jwillmore@fastmail.us>
Subject: Re: Error received opening file
Message-Id: <pan.2004.11.09.16.45.08.966941@fastmail.us>
On Tue, 09 Nov 2004 11:42:15 -0500, James Willmore wrote:
> On Tue, 09 Nov 2004 16:17:59 +0000, Mortgageloan2004 wrote:
>
> Some comments ....
<snip>
>> $b = "loanappnew";
>
> #single quotes used
> my $b = 'loanappnew';
On second thought ... *don't* use $a or $b ... they are use to compare
values using the sort fuction.
HTH
Jim
------------------------------
Date: Wed, 10 Nov 2004 07:56:15 +1300
From: "Tintin" <tintin@invalid.invalid>
Subject: Re: Error received opening file
Message-Id: <2vci3vF2j3e2mU1@uni-berlin.de>
"Mortgageloan2004" <mortgageloan2004@aol.com> wrote in message
news:20041109111759.07592.00000384@mb-m01.aol.com...
>I get an error every time I run this. I need to customize a html form by
> reading in the form, and printing it right back out to a newfile line by
> line.
> When it gets to line 1702 it adds a new line. THe contents of the value
> field
> need to be a variable in another script which I should be able to grab if
> I
> write this as a subroutine. I get a 500 error every time I run this.
>
> #!/usr/bin/perl
> $b = "loanappnew";
> $I=0;
> open(IN,"../pwc/loanapp.htm") || die "cannot open loanapp.htm for reading:
> $!";
> open(OUT,">$b") || die "cannot create $b: $!";
> while (<IN>) { #read a line from file $a into $_
> print OUT $_; #print that line to file $b
> if ($I=1702) {
> print OUT "<INPUT TYPE='hidden' NAME='subject' VALUE='test>";
> }
> $I++;
> }
> close(IN);
> close(OUT);
Your code doesn't do anything like your description.
Also:
perl -Mdiagnostics -cw foo
Found = in conditional, should be == at foo line 8 (#1)
(W syntax) You said
if ($foo = 123)
when you meant
if ($foo == 123)
(or something like that).
foo syntax OK
------------------------------
Date: 9 Nov 2004 16:11:33 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: extracting the super classes of an object from the outside?
Message-Id: <cmqq7l$uf$2@mamenchi.zrz.TU-Berlin.DE>
<bboett@adlp.org> wrote in comp.lang.perl.misc:
>
> Hi!
>
> another problem rose now....
>
> uhm might seem stupid, but the ISA array is available only inside the
> objects themselves, seems i can't acces them from the outside...
Huh? Can you explain that in code, please? What does it mean to be
"inside" or "outside" an object? @ISA is a package variable and behaves
like one in every aspect.
> any way to get a hold of the super classes of an object?
Actually, objects don't have super classes, classes do.
Get the object's class (we've been there already), which is also a package.
Then use (another) symref to access @ISA in that package.
Anno
------------------------------
Date: Tue, 9 Nov 2004 17:03:01 +0000 (UTC)
From: PerlFAQ Server <comdog@panix.com>
Subject: FAQ 8.22: Why do setuid perl scripts complain about kernel problems?
Message-Id: <cmqt85$p94$1@reader1.panix.com>
This message is one of several periodic postings to comp.lang.perl.misc
intended to make it easier for perl programmers to find answers to
common questions. The core of this message represents an excerpt
from the documentation provided with Perl.
--------------------------------------------------------------------
8.22: Why do setuid perl scripts complain about kernel problems?
Some operating systems have bugs in the kernel that make setuid scripts
inherently insecure. Perl gives you a number of options (described in
perlsec) to work around such systems.
--------------------------------------------------------------------
Documents such as this have been called "Answers to Frequently
Asked Questions" or FAQ for short. They represent an important
part of the Usenet tradition. They serve to reduce the volume of
redundant traffic on a news group by providing quality answers to
questions that keep coming up.
If you are some how irritated by seeing these postings you are free
to ignore them or add the sender to your killfile. If you find
errors or other problems with these postings please send corrections
or comments to the posting email address or to the maintainers as
directed in the perlfaq manual page.
Note that the FAQ text posted by this server may have been modified
from that distributed in the stable Perl release. It may have been
edited to reflect the additions, changes and corrections provided
by respondents, reviewers, and critics to previous postings of
these FAQ. Complete text of these FAQ are available on request.
The perlfaq manual page contains the following copyright notice.
AUTHOR AND COPYRIGHT
Copyright (c) 1997-2002 Tom Christiansen and Nathan
Torkington, and other contributors as noted. All rights
reserved.
This posting is provided in the hope that it will be useful but
does not represent a commitment or contract of any kind on the part
of the contributers, authors or their agents.
------------------------------
Date: 9 Nov 2004 18:37:54 GMT
From: John Bokma <postmaster@castleamber.com>
Subject: Re: Firefox broswer staring Perl CGI
Message-Id: <Xns959C807EDEDA8castleamber@130.133.1.4>
A. Sinan Unur wrote:
> John Bokma <postmaster@castleamber.com> wrote in
>> my $cgi = new CGI;
>> print $cgi->header( 'text/html' );
>>
>> I recommend calling the thingy $cgi instead of $query, printing html to
>> a query sounds odd to me.
>
> But you are not printing to a query, you are printing to STDOUT :)
LOL. I ment: calling the header method of a query sounds stupid to me.
--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
------------------------------
Date: 9 Nov 2004 18:44:18 GMT
From: John Bokma <postmaster@castleamber.com>
Subject: Re: Firefox broswer staring Perl CGI
Message-Id: <Xns959C8193F19B9castleamber@130.133.1.4>
Chris Cole wrote:
> On Mon, 08 Nov 2004 06:55:04 +0000, John Bokma wrote:
[ CGI.pm uses XHTML as default ]
> So what? XHTML is a perfectly valid way of creating web pages (CGI or
> otherwise). I have no problems with firefox displaying perl CGI using
> the default XHTML output.
XHTML is a joke. Also, quite some hosting providers don't send the right
headers, and hence can confuse browsers.
If you don't need XHTML (you don't) or don't understand it, don't use
it.
>> my $cgi = new CGI;
>> print $cgi->header( 'text/html' );
>
> Neither of these are necessary... The problem is due to something
> else.
Probably not sending out correct headers to Firefox gets confused. XHTML
is black magic, don't use it, your site can do without it perfectly.
>> I recommend calling the thingy $cgi instead of $query, printing html
>> to a query sounds odd to me.
>
> It may sound odd to you, but makes sense to me. CGI is often a DB
> front-end so a cgi query *to the db* is perfectly reasonable in this
> case.
Ah, yeah, and how does for example the header method relate to a query?
To me, $cgi makes it clear what I am doing, it's CGI.
CGI.pm is IMNSHO too much in one module anyway.
--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
------------------------------
Date: Tue, 9 Nov 2004 16:54:59 +0000
From: "Alan J. Flavell" <flavell@ph.gla.ac.uk>
Subject: Re: matching all perldoc names but no more
Message-Id: <Pine.LNX.4.61.0411091651430.19030@ppepc56.ph.gla.ac.uk>
On Tue, 9 Nov 2004, Ben Morrow wrote:
> Quoth "Alan J. Flavell" <flavell@ph.gla.ac.uk>:
> >
> > It'll reliably do a specific job. I'd suggest that the use of the
> > word "unsafe" in the documentation is a bit misleading. I think in
> > this specific reference it means "might not do what the naive reader
> > expects"; but "unsafe" often refers to the possibility of malicious
> > data causing security-relevant damage to result (such as, for example,
> > unintended interpolation taking place using externally-derived data),
> > and that's not what is intended here, AFAICS.
>
> The locale is externally-derived data. A malicious user could (under
> some OSen at least) construct their own locale that said ';' was a word
> character.
Good call. I withdraw the comment.
> I would hope (but I haven't tested) that if 'use locale' is in effect
> and the locale setting was tainted then such regexen won't untaint...
Let's hope so.
> > > but \w may vary in different locales.
> >
> > Which, in some situations, might be exactly what one wants.
>
> Of course, but not when dealing with shell metachars.
I take it you were commenting here on the specific problem, rather
than on the cited documentation as such.
cheers
------------------------------
Date: Tue, 09 Nov 2004 14:22:38 -0500
From: wana <ioneabu@yahoo.com>
Subject: Re: matching all perldoc names but no more
Message-Id: <10p22tilpenhdd@news.supernews.com>
Alan J. Flavell wrote:
> On Tue, 9 Nov 2004, Ben Morrow wrote:
>
>> Quoth "Alan J. Flavell" <flavell@ph.gla.ac.uk>:
>> >
>> > It'll reliably do a specific job. I'd suggest that the use of the
>> > word "unsafe" in the documentation is a bit misleading. I think in
>> > this specific reference it means "might not do what the naive reader
>> > expects"; but "unsafe" often refers to the possibility of malicious
>> > data causing security-relevant damage to result (such as, for example,
>> > unintended interpolation taking place using externally-derived data),
>> > and that's not what is intended here, AFAICS.
>>
>> The locale is externally-derived data. A malicious user could (under
>> some OSen at least) construct their own locale that said ';' was a word
>> character.
>
> Good call. I withdraw the comment.
>
>> I would hope (but I haven't tested) that if 'use locale' is in effect
>> and the locale setting was tainted then such regexen won't untaint...
>
> Let's hope so.
>
>> > > but \w may vary in different locales.
>> >
>> > Which, in some situations, might be exactly what one wants.
>>
>> Of course, but not when dealing with shell metachars.
>
> I take it you were commenting here on the specific problem, rather
> than on the cited documentation as such.
>
> cheers
Thanks to all for further discussion. I still think that the security issue
with tainted data is at least partly the intent of this paragraph in
perlre. I mentioned that the \w topic is also discussed in perlsec:
This is fairly secure because "/\w+/" doesn’t normally
match shell metacharacters, nor are dot, dash, or at going
to mean something special to the shell. Use of "/.+/"
would have been insecure in theory because it lets every
thing through, but Perl doesn’t check for that. The les
son is that when untainting, you must be exceedingly care
ful with your patterns. Laundering data using regular
expression is the only mechanism for untainting dirty
data, unless you use the strategy detailed below to fork a
child of lesser privilege.
The example does not untaint $data if "use locale" is in
effect, because the characters matched by "\w" are deter
mined by the locale. Perl considers that locale defini
tions are untrustworthy because they contain data from
outside the program. If you are writing a locale‐aware
program, and want to launder data with a regular expres
sion containing "\w", put "no locale" ahead of the expres
sion in the same block. See "SECURITY" in perllocale for
further discussion and examples.
The second paragraph makes it clear that this is the issue. It is really
not a big deal and on the outer fringes of my perl knowledge as a newbie
and an amateur. I just wanted to make my point that what I read in perlre
meant what I thought it meant. At least I am finally reading my perldocs
before posting!
wana
------------------------------
Date: Tue, 9 Nov 2004 18:41:10 +0000
From: "Alan J. Flavell" <flavell@ph.gla.ac.uk>
Subject: Re: matching all perldoc names but no more
Message-Id: <Pine.LNX.4.61.0411091837480.19132@ppepc56.ph.gla.ac.uk>
On Tue, 9 Nov 2004, wana wrote:
> Alan J. Flavell wrote:
[snip]
> > Good call. I withdraw the comment.
[snip]
> Thanks to all for further discussion. I still think that the security issue
> with tainted data is at least partly the intent of this paragraph in
> perlre.
Just so. That's why I accepted that my comment had been misguided.
> I mentioned that the \w topic is also discussed in perlsec:
[...]
> The second paragraph makes it clear that this is the issue. It is
> really not a big deal and on the outer fringes of my perl knowledge
> as a newbie and an amateur. I just wanted to make my point that
> what I read in perlre meant what I thought it meant. At least I am
> finally reading my perldocs before posting!
Absolutely. My apologies that I missed this point the first time
around. It'll remind me to check the documentation properly myself
instead of just skim-reading it.
Umble pie for tea today...
cheers
------------------------------
Date: 9 Nov 2004 08:32:06 -0800
From: google@digitalbubblebath.com (Matt C)
Subject: perldoc mirror?
Message-Id: <c06931e3.0411090832.56e4aad3@posting.google.com>
Hello all,
is there an alternate location for the documentation that is up on
perldoc.com? Over the last few weeks it has gone through periods of
timing out on me when trying to search the docs. Can't find a mirror
anywhere...
Cheers
matt
------------------------------
Date: Tue, 09 Nov 2004 16:37:18 GMT
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: perldoc mirror?
Message-Id: <2n6kd.811$5H4.473@trndny06>
"Matt C" <google@digitalbubblebath.com> wrote in message
news:c06931e3.0411090832.56e4aad3@posting.google.com...
> is there an alternate location for the documentation that is up on
> perldoc.com? Over the last few weeks it has gone through periods of
> timing out on me when trying to search the docs. Can't find a mirror
> anywhere...
http://www.perlpod.com/5.8.4/pod/perltoc.html
Found as the 10th hit off Google for "perldoc mirror".
You must have an odd definition of "anywhere"...
Paul Lalli
------------------------------
Date: 9 Nov 2004 18:35:43 GMT
From: John Bokma <postmaster@castleamber.com>
Subject: Re: sub refs in qq strings
Message-Id: <Xns959C801CA6D15castleamber@130.133.1.4>
Tad McClellan wrote:
> John Bokma <postmaster@castleamber.com> wrote:
>
>> I don't get the interpolation thingy.
>
> perldoc -q 'function calls'
>
> How do I expand function calls in a string?
Oh, I know that ;-) Been there, quite some time ago though (something with
HTML templates ;-) ). What I mean, I don't get it why one needs
interpolation to create a dispatch table when there are hashes ;-)
--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
------------------------------
Date: Tue, 09 Nov 2004 11:12:01 -0500
From: James Willmore <jwillmore@fastmail.us>
Subject: Re: why is pattern matching using '|' slower than 2 separate ones?
Message-Id: <pan.2004.11.09.16.11.59.939345@fastmail.us>
On Tue, 09 Nov 2004 15:56:26 +0000, A. Sinan Unur wrote:
> James Willmore <jwillmore@fastmail.us> wrote in
> news:pan.2004.11.09.15.53.59.12888@fastmail.us:
>
>> On Tue, 09 Nov 2004 08:53:12 -0500, Mark Seger wrote:
<snip>
>> You might want to throw in the 'o' modifier to the regexs
>
> Why? There is no interpolation happening here.
What harm is there in compiling a regex that doesn't do interpolation?
------------------------------
Date: Tue, 09 Nov 2004 11:15:57 -0500
From: James Willmore <jwillmore@fastmail.us>
Subject: Re: why is pattern matching using '|' slower than 2 separate ones?
Message-Id: <pan.2004.11.09.16.15.52.898012@fastmail.us>
On Tue, 09 Nov 2004 11:12:01 -0500, James Willmore wrote:
> On Tue, 09 Nov 2004 15:56:26 +0000, A. Sinan Unur wrote:
>
>> James Willmore <jwillmore@fastmail.us> wrote in
>> news:pan.2004.11.09.15.53.59.12888@fastmail.us:
>>
>>> On Tue, 09 Nov 2004 08:53:12 -0500, Mark Seger wrote:
> <snip>
>
>>> You might want to throw in the 'o' modifier to the regexs
>>
>> Why? There is no interpolation happening here.
>
> What harm is there in compiling a regex that doesn't do interpolation?
Uri posted why ...
Never mind the question :-)
------------------------------
Date: Tue, 09 Nov 2004 11:16:45 -0500
From: James Willmore <jwillmore@fastmail.us>
Subject: Re: why is pattern matching using '|' slower than 2 separate ones?
Message-Id: <pan.2004.11.09.16.16.44.476922@fastmail.us>
On Tue, 09 Nov 2004 15:58:50 +0000, Uri Guttman wrote:
>>>>>> "JW" == James Willmore <jwillmore@fastmail.us> writes:
>
> JW> $a=1 if $z=~/xxxxx|yyyyy/o;
> JW> # $a=1 if $z=~/xxxxx/o or $z=~/yyyyy/o;
>
> JW> The 'o' modifier compiles the regex once, so it doesn't need to be
> JW> compiled latter on. Running the same tests on my system showed some
> JW> improvement, but not much.
>
> /o only doesn't recompile when there are variables in the regex. a fixed
> string regex like those won't get any help from /o. and in recent perls
> the regex is not recompiled if the variables haven't changed so much of
> the need for /o is gone. also with qr// to handle compiling a regex once
> and allowing its reuse, the need for /o is almost totally gone.
I didn't realize that new versions of Perl reduced the need to use /o.
Thanks.
------------------------------
Date: 9 Nov 2004 16:24:51 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: why is pattern matching using '|' slower than 2 separate ones?
Message-Id: <cmqr0j$uf$3@mamenchi.zrz.TU-Berlin.DE>
James Willmore <jwillmore@fastmail.us> wrote in comp.lang.perl.misc:
> On Tue, 09 Nov 2004 15:56:26 +0000, A. Sinan Unur wrote:
>
> > James Willmore <jwillmore@fastmail.us> wrote in
> > news:pan.2004.11.09.15.53.59.12888@fastmail.us:
> >
> >> On Tue, 09 Nov 2004 08:53:12 -0500, Mark Seger wrote:
> <snip>
>
> >> You might want to throw in the 'o' modifier to the regexs
> >
> > Why? There is no interpolation happening here.
>
> What harm is there in compiling a regex that doesn't do interpolation?
Huh? Are you saying that /o *compiles* a regex?
Every regex must be compiled before it is used. When there is no
interpolation, that happens once at compile time. When there is,
the regex is recompiled before each use, in case the interpolating
string has changed. /o suppresses this re-compilation. As has been
noted, newer Perls only do the re-compilation when the string has
actually changed, but /o still suppresses it.
So /o plainly has no effect at all when there is no interpolation.
Anno
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 7385
***************************************