[15493] in Perl-Users-Digest
Perl-Users Digest, Issue: 2903 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Apr 29 11:05:27 2000
Date: Sat, 29 Apr 2000 08:05:12 -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: <957020711-v9-i2903@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sat, 29 Apr 2000 Volume: 9 Number: 2903
Today's topics:
Re: clearning contents of a hash (M.J.T. Guy)
Re: Co (Tad McClellan)
Re: control-backslash in a literal string <rootbeer@redcat.com>
Re: Help )How can I do this? <rootbeer@redcat.com>
Help - If/Contains/Case/Array Beginners Question <NoSpam@NoSpam.Com>
Re: Help - If/Contains/Case/Array Beginners Question <dave@dave.org.uk>
Re: Help - If/Contains/Case/Array Beginners Question <NoSpam@NoSpam.Com>
Re: Help I'm at a loss! (Michael P. Soulier)
Re: Help I'm at a loss! <rootbeer@redcat.com>
help me <harris@rock.upnaway.com>
Re: help me (Michael P. Soulier)
Re: help me <rootbeer@redcat.com>
Re: help with @inc please <rootbeer@redcat.com>
Re: HELP! text file problem! <morbus@disobey.com>
Re: HELP! text file problem! <flavell@mail.cern.ch>
Re: how do you find perl? (Bart Lateur)
Re: how to "uudecode" binaries? <rootbeer@redcat.com>
Re: how to get the error string for ($? >> 8) (M.J.T. Guy)
Re: how to measure processing time by millisecond unit jbellack@my-deja.com
Re: how to measure processing time by millisecond unit <flavell@mail.cern.ch>
Re: Idea: Soft sub refs and taint? <rootbeer@redcat.com>
Re: interesting semantic distinction... <rootbeer@redcat.com>
Re: man2html lvirden@cas.org
Re: mod-rewrite redirect using regexp <dimitrio@perlnow.com>
Re: Perl Free Online Courses lvirden@cas.org
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 29 Apr 2000 14:36:30 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: clearning contents of a hash
Message-Id: <8ees1e$bi4$1@pegasus.csx.cam.ac.uk>
In article <x7bt2w4xhv.fsf@home.sysarch.com>,
Uri Guttman <uri@sysarch.com> wrote:
>>>>>> "A" == <anon@nic.harvard.edu> writes:
>
> A> undef %hash;
>
>a poor choice. assigning () is much simpler and cleaner. my biggest beef
>with undefining aggregates is that it leads newbies to using defined to
>see if the aggregates have any values and that is totally wrong.
Wrong! Wrong!! Wrong!!!
Watch this small test:
% perl
for (1..10000) {
my %x;
@x{1..1000}=();
push @y, \%x;
%x = (); # or undef %x;
};
__END__
That uses 83 megabytes. Now change that to undef and it uses 3352K.
To free a hash, always use "undef %hash".
Mike Guy
------------------------------
Date: Fri, 28 Apr 2000 21:11:52 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Co
Message-Id: <slrn8gkdmo.445.tadmc@magna.metronet.com>
On Fri, 28 Apr 2000 16:17:53 -0500, Tom Briles <sariq@texas.net> wrote:
>Tom Briles wrote:
>> print DATA "$ref->[$i]blah blah blah \n";
>
>Ack! Someone kindly berate me for not cutting-and-pasting.
Your feet stink!
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 28 Apr 2000 19:40:50 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: control-backslash in a literal string
Message-Id: <Pine.GSO.4.10.10004281937080.21722-100000@user2.teleport.com>
On Fri, 28 Apr 2000, John Wiersba wrote:
> How do I specify ^\ (control-backslash), using \c notation?
You can't; use a different notation.
There was a long, long, looooong discussion of this on the p5p list last
November. Look for the "[ID 19991118.014]" messages here, if you want to
re-live the pain. :-)
http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/1999-11/thrd9.html
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sat, 29 Apr 2000 07:53:09 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Help )How can I do this?
Message-Id: <Pine.GSO.4.10.10004290748060.21722-100000@user2.teleport.com>
On Sat, 29 Apr 2000, yoon wrote:
> Subject: Help )How can I do this?
Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.
http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post
> I have one file which includes "cgi-lib" which has defines "FORM".
It's often better to use the CGI module.
> I attach my program.
Please don't do that. Your message was over 50K long! Instead, cut your
program down to the smallest self-contained example which illustrates the
one or two lines of code which aren't doing what you want.
> begin 666 course_up.cgi
> M(R$O=7-R+VQO8V%L+V)I;B]P97)L"@HC(R,C(R,C(R,C(R,C(R,C(R,C(R,C
> M(R,C(R,C(R,C(R,C(R,C(R,C(R,C"B,@(%1H:7,@0T=)(&ES('1O(&-H86YG
And don't post binaries to non-binary newsgroups! (Yes, that's a "binary",
at least as far as this restriction is concerned.)
When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to solving
such problems. It's available on CPAN.
http://www.perl.com/CPAN/
http://www.cpan.org/
http://www.cpan.org/doc/FAQs/cgi/idiots-guide.html
http://www.cpan.org/doc/manual/html/pod/
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sat, 29 Apr 2000 12:06:22 +0100
From: "Paul" <NoSpam@NoSpam.Com>
Subject: Help - If/Contains/Case/Array Beginners Question
Message-Id: <8eefnr$77i$1@newsg1.svr.pol.co.uk>
Hi,
[very simple beginners question]
I am trying to check to see if the environmental variable HTTP_REFERER
contains any element from an array.
e.g. myarray=(test1,test2,test3,test4)
if HTTP_REFERER contains any element in myarray (case insenstitive) then
stop the script.
I have looked at several scripts and everyone seems to do it a different
[complicated] way.
Any suggestions appreciated with a bit of explanation would be great,
Cheers
Paul.
------------------------------
Date: Sat, 29 Apr 2000 12:52:15 +0100
From: Dave Cross <dave@dave.org.uk>
Subject: Re: Help - If/Contains/Case/Array Beginners Question
Message-Id: <0vilgs04a8o1a5hsfo6l9qarm9995csnps@4ax.com>
On Sat, 29 Apr 2000 12:06:22 +0100, "Paul" <NoSpam@NoSpam.Com> wrote:
>Hi,
>
>[very simple beginners question]
>
>I am trying to check to see if the environmental variable HTTP_REFERER
>contains any element from an array.
>
>e.g. myarray=(test1,test2,test3,test4)
>
>if HTTP_REFERER contains any element in myarray (case insenstitive) then
>stop the script.
>
>I have looked at several scripts and everyone seems to do it a different
>[complicated] way.
>
>Any suggestions appreciated with a bit of explanation would be great,
Sounds to me like the answer to the question "How can I tell whether a
list or array contains a certain element?" might be of some help to
you. This question is answered in perlfaq4, which was installed on
your system, when you installed Perl.
hth,
Dave...
--
<http://www.dave.org.uk> SMS: sms@dave.org.uk
YAPC::Europe - London, 22 - 24 Sep <http://www.yapc.org/Europe/>
"There ain't half been some clever bastards" - Ian Dury [RIP]
------------------------------
Date: Sat, 29 Apr 2000 14:06:38 +0100
From: "Paul" <NoSpam@NoSpam.Com>
Subject: Re: Help - If/Contains/Case/Array Beginners Question
Message-Id: <8eemur$208$1@newsg4.svr.pol.co.uk>
Hi,
Thanks for replying so quickly, I saw this in the faq (How can I tell
whether an array contains a certain element?) but it was doing exact matches
I want where any part of an element in an array is anywhere in HTTP_REFERER?
(I wish case insensitive matches also?)
e.g. array="org","net"
if HTTP_REFERER="www.dsjghsdkjg.org it would find a match at element 1
if HTTP_REFERER="www.network.org it would find a match at element 2 (as net
is in the string)
if HTTP_REFERER="www.dsgsg.com would not find any matches as org or net is
not anywhere in the string
Any further comments appreciated...
Cheers
Paul.
"Dave Cross" <dave@dave.org.uk> wrote in message
news:0vilgs04a8o1a5hsfo6l9qarm9995csnps@4ax.com...
> On Sat, 29 Apr 2000 12:06:22 +0100, "Paul" <NoSpam@NoSpam.Com> wrote:
>
> >Hi,
> >
> >[very simple beginners question]
> >
> >I am trying to check to see if the environmental variable HTTP_REFERER
> >contains any element from an array.
> >
> >e.g. myarray=(test1,test2,test3,test4)
> >
> >if HTTP_REFERER contains any element in myarray (case insenstitive) then
> >stop the script.
> >
> >I have looked at several scripts and everyone seems to do it a different
> >[complicated] way.
> >
> >Any suggestions appreciated with a bit of explanation would be great,
>
> Sounds to me like the answer to the question "How can I tell whether a
> list or array contains a certain element?" might be of some help to
> you. This question is answered in perlfaq4, which was installed on
> your system, when you installed Perl.
>
> hth,
>
> Dave...
> --
> <http://www.dave.org.uk> SMS: sms@dave.org.uk
> YAPC::Europe - London, 22 - 24 Sep <http://www.yapc.org/Europe/>
>
> "There ain't half been some clever bastards" - Ian Dury [RIP]
------------------------------
Date: 29 Apr 2000 14:24:07 GMT
From: msoulier@storm.ca (Michael P. Soulier)
Subject: Re: Help I'm at a loss!
Message-Id: <slrn8glse9.bco.msoulier@localhost.localdomain>
On Sat, 29 Apr 2000 00:26:07 -0500, Z-man <dzapped@theramp.net> wrote:
>Please Help I'm running my scripts on a win98 box.I have one script that
>I can't seem to get past this error the statement is as follows:
>if ($in{'update_html'}) {
> &demo_html;
> $pid=fork();
> if ($pid) {
> &header_html;
> &script_setup_html;
> &footer_html;
> } else {
> close (STDOUT);
> &update_html1;
> }
> }
>Now I know fork is unimplemented on windows ,normally if i remove a
>reference to it the scripts run,
>in this case if i remove fork the script returns doc contains no data,If
By removing the fork() reference, I assume you also mean removing the if
structure?
You haven't given us enough information to debug this.
Mike
--
Michael P. Soulier <msoulier@storm.ca>
--------------------------------------
"To listen to the words of the learned, and to instill into others the
lessons of science, is better than religious exercises."
-- Prophet Muhammad (pbuh)
------------------------------
Date: Sat, 29 Apr 2000 07:26:45 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Help I'm at a loss!
Message-Id: <Pine.GSO.4.10.10004290725560.21722-100000@user2.teleport.com>
On Sat, 29 Apr 2000, Z-man wrote:
> Subject: Help I'm at a loss!
Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.
http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post
> in this case if i remove fork the script returns doc contains no data,
When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to solving
such problems. It's available on CPAN.
http://www.perl.com/CPAN/
http://www.cpan.org/
http://www.cpan.org/doc/FAQs/cgi/idiots-guide.html
http://www.cpan.org/doc/manual/html/pod/
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sat, 29 Apr 2000 18:39:15 +0800
From: "Garret Harris" <harris@rock.upnaway.com>
Subject: help me
Message-Id: <390ab448@usenet.per.paradox.net.au>
I'm doing a database and I need some help with a few problems
1 Does anyone know how to change an enter on a multi line text box into
something else i.e. <BR> because I have to store a comment on a file but an
enter starts a new line.
------------------------------
Date: 29 Apr 2000 14:25:50 GMT
From: msoulier@storm.ca (Michael P. Soulier)
Subject: Re: help me
Message-Id: <slrn8glshg.bco.msoulier@localhost.localdomain>
On Sat, 29 Apr 2000 18:39:15 +0800, Garret Harris <harris@rock.upnaway.com>
wrote:
>I'm doing a database and I need some help with a few problems
>1 Does anyone know how to change an enter on a multi line text box into
>something else i.e. <BR> because I have to store a comment on a file but an
>enter starts a new line.
You're going to have to restate the question. I don't understand what
you're asking.
Mike
--
Michael P. Soulier <msoulier@storm.ca>
--------------------------------------
"To listen to the words of the learned, and to instill into others the
lessons of science, is better than religious exercises."
-- Prophet Muhammad (pbuh)
------------------------------
Date: Sat, 29 Apr 2000 08:03:12 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: help me
Message-Id: <Pine.GSO.4.10.10004290801590.21722-100000@user2.teleport.com>
On Sat, 29 Apr 2000, Garret Harris wrote:
> 1 Does anyone know how to change an enter on a multi line text box
> into something else i.e. <BR> because I have to store a comment on a
> file but an enter starts a new line.
It sounds as if you're trying to get some other software than perl to do
something. Could it be a web browser you're working with? Perhaps you want
to search for the docs, FAQs, and newsgroups about the other software.
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sat, 29 Apr 2000 07:22:49 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: help with @inc please
Message-Id: <Pine.GSO.4.10.10004290651500.21722-100000@user2.teleport.com>
On Sat, 29 Apr 2000 jlamport@calarts.edu wrote:
> Tom Phoenix <rootbeer@redcat.com> wrote:
> >
> > Check what the FAQ says about keeping your own directory for modules,
>
> And if you find out just *where* I can find this elusive FAQ, let me
> know. I asked about this recently and only got some snotty suggestion
> about grep'ing through the entire perl installation on my system.
I'm sorry to hear that you didn't like the responses you got. There are
many ways to find things like this in the documentation, depending upon
your preferences. If you have a very recent perl installed, it's
especially easy to see all FAQ entries whose title mentions 'modules':
perldoc -q module
But let's suppose that you have an older version of perl whose perldoc
command lacks the -q option. Using this case as an example:
1. Open the perltoc (Table of Contents) manpage in your
favorite way.
2. Search for a line which includes both the words 'module'
and 'directory'. You should find "How do I keep my own
module/library directory?" in the section for perlfaq8.
3. Find that question and answer in perlfaq8.
This has the advantage that you're likely to spot many other interesting
questions along the way.
If you haven't seen it yet, check out the perlfaq website for an
alternative way to get answers.
http://www.perlfaq.com/
> > and see the docs for the 'lib' pragma.
> This cryptic remark is intended, I believe, to point you towards
> these:
>
> man perlmodlib
> perldoc lib
Well, it didn't seem cryptic to me! But since I meant only the second of
those, it must not have been so clear as I thought.
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sat, 29 Apr 2000 09:50:51 -0400
From: Morbus Iff <morbus@disobey.com>
Subject: Re: HELP! text file problem!
Message-Id: <morbus-BA1AA0.09505129042000@news.totalnetnh.net>
In article <39097D21.3839535C@hotmail.com>, Mark <markchu@hotmail.com>
wrote:
> Does anyone know how to get the total rows in a text file when using
> perl?
open(FILE, $file);
my @lines = <FILE>;
close(FILE);
foreach my $line (@lines) {
$i++;
}
print "Total Rows: $i";
Morbus Iff
http://www.disobey.com/
------------------------------
Date: Sat, 29 Apr 2000 15:57:25 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: HELP! text file problem!
Message-Id: <Pine.GHP.4.21.0004291554400.16151-100000@hpplus01.cern.ch>
On Sat, 29 Apr 2000, Morbus Iff wrote:
> open(FILE, $file);
Bad advice already. Please read and understand the discussion on the
group, instead of offering misleading/suboptimal answers.
> my @lines = <FILE>;
Is this your bid for membership of the purltroll consortium?
--
Partake of distilled wisdom of Usenet - read the FAQs.
Before you ask.
------------------------------
Date: Sat, 29 Apr 2000 11:46:29 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: how do you find perl?
Message-Id: <390acb4b.853259@news.skynet.be>
Brian Smith wrote:
>Ok, I built a linut box running latest version of RedHat to run and test
>perl that I write. How do I find where perl is located? I think its
>/usr/bin/perl but I keep getting internal server errors when I try to run my
>scripts. And I know they work fine.
Telnet, or at the console, type "which perl".
Another popular location is "/usr/local/bin/perl". If you want your
scripts to be portable, and no have to update that shebang line when
copying scripts to a different server, you can create a symbolic link
for one location to the other. Then both shebang lines would work.
Of course, this trick will be limited to conforming your private server
box, to the server of your ISP.
--
Bart.
------------------------------
Date: Sat, 29 Apr 2000 07:30:17 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: how to "uudecode" binaries?
Message-Id: <Pine.GSO.4.10.10004290728160.21722-100000@user2.teleport.com>
On Sat, 29 Apr 2000, ULf Berger wrote:
> i also tried using "convert::uu" but failed again :-(
Maybe you should spell it Convert::UU - perl is case-sensitive. If that's
not your problem, double-check that you're using the module according to
its documentation, then reduce your code to the smallest self-contained
example which illustrates the problem and post that here so that others
can try it and perhaps see the problem. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 29 Apr 2000 15:00:47 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: how to get the error string for ($? >> 8)
Message-Id: <8eetev$cqi$1@pegasus.csx.cam.ac.uk>
Jonathan Stowe <gellyfish@gellyfish.com> wrote:
>On Mon, 24 Apr 2000 14:40:26 GMT li wrote:
>>
>> Is there a way to get the error string for errors returned by 'system'
>> command?
>>
>> Graham Barr's Errno.pm gives the system E* status code, but how do one
>> gets the string? (By getting correspondent comment line in the
>> errno.h? :-)
>>
>
>As far as I can determine these messages are the same as the ones you would
>get by assigning the value to $! and printing the result but YMMV :
Not sure what you mean by "these messages". The things that Errno.pm
deals with are indeed the same as the string values of $!. But
they have no relation to what the OP was asking, which was about the
return values from system, i.e. $?.
Apart from "0 means success", there are no standardised values for
exit codes. You have to look at the manpage for the particular program
to find out what they mean.
Mike Guy
------------------------------
Date: Sat, 29 Apr 2000 10:41:59 GMT
From: jbellack@my-deja.com
Subject: Re: how to measure processing time by millisecond unit
Message-Id: <8eee9m$b2i$1@nnrp1.deja.com>
I have to disagree with Andrea's comments below.
Time in milliseconds can be extremely important
when optimizing code for high-traffic Web sites.
A few jobs back, I was responsible for a financial
Web site that got ~ 1m pageviews per day. Our
application server (ColdFusion) reported
processing time for individual templates in
milliseconds; our database (SQL Server) reported
SQL query times in milliseconds. 1/100 or 1/1000
second wasn't relevant, but 1/10 of a second
variances were very relevant. The difference
between a page taking 250 milliseconds and a page
taking 70 milliseconds had an enormous impact on
our overall server performance. We had a few
database queries that took ~ 500ms to process, and
this time delay was actually visible to the user &
made that page appear 'sluggish' compared to other
financial sites. We optimized the query down to <
100ms, and the complaints went away.
I'll grant that it's possible to get too
fine-grained -- 20ms vs 30ms ain't that important
-- but there is a place for sub-second response
times in code optimization.
-- Jonathan Bellack
jonathan@bellack.com
(web geek @ Eazel, but I own my own words)
In article <8e56ge$68s$1@nnrp1.deja.com>,
Andrea Alexandria Sarkut <alexandria_sarkut@my-deja.com> wrote:
>
[some stuff omitted for brevity]
>
> Measurements down to hundreds or tens of milliseconds
> are basically useless unless you are involved in some
> exacting scientific research using computer technology.
> It is safe to say you do not have the type of hardware
> needed to ensure accuracy on any time measurement less
> than thousands of milliseconds, or what we know as common
> day seconds. You need expensive laboratory equipment to
> realize exacting accuracy of any time measurement less
> than one-thousand milliseconds. At best, using a typical
> Personal Computer, your accuracy would be plus or minus
> five seconds for reiteration tests, in a final analysis.
>
> These type of measurements, milliseconds, are highly
> quesionable for realistic concerns as well. Recently
> a person here compared benchmarks for a hand written
> read/parse routine and the equal using cgi.pm module.
> After one-hundred-thousand iterations, a time difference
> of two seconds was illogically reported. I say illogical
> because no consideration is given to margin of error.
> Two seconds falls well within margin of error factors.
>
> In this case, given two seconds is accurate, an average
> internet site, using a form action with five input variables
> experiencing twenty-thousand hits per year, would realize
> a CPU time savings of two seconds per year or, a one minute
> savings in CPU time over the course of thirty years.
>
> Obviously this type of thinking, shaving off two seconds
> over the course of a year, it most illogical and quite
> impractical if not ludicrous.
>
> Do you truly need to worry about an amount of time
> less than it takes you to blink your eyes?
>
> Consider removing the decimal point, appending zeroes
> as needed and be pleased with how little effort it takes
> to do this with no more than ten minutes time invested
> in writing simple Perl coding.
>
> Andrea Alexandria Sarkut
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sat, 29 Apr 2000 13:23:47 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: how to measure processing time by millisecond unit
Message-Id: <Pine.GHP.4.21.0004291313580.5307-100000@hpplus01.cern.ch>
On Sat, 29 Apr 2000 jbellack@my-deja.com wrote:
> I have to disagree with Andrea's comments below.
Why aren't you putting the relevant point ahead of your comment so
that we can understand what the heck you're getting at?
Here's a relevant comment that you say you disagree with:
> > It is safe to say you do not have the type of hardware
> > needed to ensure accuracy on any time measurement less
> > than thousands of milliseconds,
Please support your claim. While it's certainly possible to achieve
that in a well-controlled environment, we're talking here about real
life server job mix situations, as I understand it.
> Time in milliseconds can be extremely important
> when optimizing code for high-traffic Web sites.
Then design your benchmark so that it works, i.e does not depend on
accurate measurements of individual time intervals at that level of
granularity.
And pay attention to your posting style. The killfile is currently
seeking new applicants.
--
Partake of distilled wisdom of Usenet - read the FAQs.
Before you ask.
------------------------------
Date: Sat, 29 Apr 2000 07:46:04 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Idea: Soft sub refs and taint?
Message-Id: <Pine.GSO.4.10.10004290743130.21722-100000@user2.teleport.com>
On 29 Apr 2000, Neil Kandalgaonkar wrote:
> Perhaps soft subroutine references should fail if the data is
> tainted?
>
> &{$tainted}; # fatal under notional new taint feature.
Well, you'd (almost certainly) need to use a pragma to enable this, so as
to not break legacy code. (Still, maybe legacy code which breaks this rule
should be kicked....) I don't see why it couldn't be done. Be sure to let
perlbug know when you've got the patch ready! :-)
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sat, 29 Apr 2000 07:36:08 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: interesting semantic distinction...
Message-Id: <Pine.GSO.4.10.10004290731530.21722-100000@user2.teleport.com>
On Sat, 29 Apr 2000 jlamport@calarts.edu wrote:
> while(<FH>) {
> ...
> }
>
> is *not* semantically equivalent to
>
> while($_=<FH>) {
> ...
> }
According to my interpretation of my copy of the perlop manpage (from Perl
5.6.0), they are now equivalent. (They were not equivalent in 5.004,
according to my memory.)
> it is, instead, semantically equivalent (I think) to
>
> while( defined($_=<FH>) ) {
> ...
> }
...and that one is now the same as the other two. There's actually a list
of equivalents in perlop explaining this case.
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 29 Apr 2000 10:06:33 GMT
From: lvirden@cas.org
Subject: Re: man2html
Message-Id: <8eec79$jnf$1@srv38.cas.org>
According to Jonathan Stowe <gellyfish@gellyfish.com>:
:Quite honestly I wouldnt bother ;-} If you get the latest version of
:'groff' then you can do :
:
: groff -man -Thtml /usr/man/man1/red.1
:
Is there similar drivers so that groff could directly create PDF files?
What I really would like to be able to do is to create one PDF with all
of the perl man pages indexed, bookmarked and searchable. I just am
uncertain what tools are available.
--
<URL: http://dev.scriptics.com/>
<URL: mailto:lvirden@cas.org> <URL: http://www.purl.org/NET/lvirden/>
Unless explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.
------------------------------
Date: Sat, 29 Apr 2000 14:27:26 GMT
From: "Dimitri Ostapenko" <dimitrio@perlnow.com>
Subject: Re: mod-rewrite redirect using regexp
Message-Id: <ijCO4.157099$1C2.3955423@news20.bellglobal.com>
Godzilla! <godzilla@stomp.stomp.tokyo> wrote in message
news:390A655B.5FB34823@stomp.stomp.tokyo...
> Dimitri Ostapenko wrote:
>
> > I'm sorry to post this here, but I already tried
> > com.infosystems.www.servers and couldn't get an answer.
>
> > I need to redirect to perl script based on substring in URL:
>
> > http://www.xyz.com/q.phtml?client=AAA
>
> > to
>
> > http://www.xyz.com/redir.pl?file=q.phtml&client=AAA
>
>
> Dimitri, with this software you are using, regardless
> of your rule sets, for this to work, your final output
> must be in this general format:
>
> http...etc/redir.pl?Key=Value&Key=Value
>
> Your client=AAA would pass just fine. I am not
> so sure your q.phtml would because of the period
> in there. This depends a lot on your read/parse
> routine and how it would handle this. Probably
> ok on this but double check.
>
>
> > RewriteEngine On
> > RewriteBase /
> > RewriteRule ^([^?&]+)[?&]client=([^/?&]+)redir.pl?file=$1&client=$2 [NC]
>
> > Now '&' works just fine, but '?' does not, even prepended
> > with '\' (which it shouldn't be in char class anyway). I
> > also can't match ? before client with '.', \?, \S
>
> Escaping a question mark ? does not alway work
> as you think it will. There are circumstances
> when standard techniques completely fail, much
> to your surprise and disbelieve of others. Looks
> like you are learning this as I did long ago.
> There is a way to avoid a lot of meta-characters
> by using "less fancy" matching operators. I will
> close with an example of less eloquence but greater
> ease in writing.
>
>
> Here is what I would suggest on this Dimitri. You are
> working with some software with which not many people
> are experienced. If it was me wearing your programmer
> hat, I would go to this page:
>
> http://www.apache.org/docs/mod/mod_rewrite.html
>
> Study well what is there to get a "feel" for how
> this works. I would _literally_ study every item
> listed to get to know this software inside and out.
> I would also try hard to mimic his examples as
> closely as possible for testing and learning,
> I mean actually use his URL addresses and all,
> as if I am really going to setup just as he
> outlines on that page. Then try it.
>
> This is not easy software to master without a good
> basic knowledge of how it works. Once you know
> this software like a long time lover, you will
> feel less awkward. To truly please a lover, you
> must engage in a lots of foreplay, it this case,
> learning all you can, before doing it. ;)
>
> For now, consider this sincere suggestion.
> Backup on your rules for redirect. Start with
> the most simple possible redirect rule you
> can write, get it working, then add a little
> bit more to it slowly. Test a lot, add a little.
> Avoid meta-characters at first, they will eat
> your mind in a hurry.
>
> KISS : Keep It Simple Silly
>
> You are dealing with standard Perl style
> matching operators. There are lots and
> lots of sites and reference material
> available to assist you in writing
> correct rules for your software.
> Make use of those resources.
>
> Get to know this software by studying
> his page, testing his examples. Read
> up on regex formats. You will do ok
> in time, if you put out effort.
>
> Here is something which might point you
> in a right direction for your rules, a
> simple one to catch most addresses but
> is not a copy and paste, it is a character
> set format which may help you by analogy:
>
> !(http://[~\-a-z0-9_/\.]+\.\S+)! your redirect here !
>
> This is the best I can offer to point you
> to thinking about how you might want to
> approach this, AFTER you study his site
> pages forwards, backwards and upside down.
>
>
> Godzilla!
Gee, thanks for the time u spent to answer.
I did exactly what u suggest and started with mod-rewrite docs and examples,
which I read at least twice. Pretty much I feel comfortable about the whole
thing now but I have 1 specific problem.
It's not that I don't understand how mod-rewrite regexp work - they do just
like Perl's - it's just that there's some exception regarding '?' which of
course is a metacharacter, but should be matched in char class ( or with '.'
or '\S' or \? ) . Well, it doesn't.
Redirect does work for any other character - I tried.
I was hoping that somebody here was using mod-rewrite and would be able to
answer. If not - that's ok. I might still get an answer from Ralf S.
Engelschall.
Dimitri
------------------------------
Date: 29 Apr 2000 10:12:43 GMT
From: lvirden@cas.org
Subject: Re: Perl Free Online Courses
Message-Id: <8eecir$jug$1@srv38.cas.org>
According to Luxe <kkentkNOkkSPAM@yahoo.com.invalid>:
: A site called FreeEdu.com offers free Perl courses on the
:internet.
Have any of the Perl experts here on clpm evaluated the soundness of the
course material? Is this something that you would be comfortable recommending
to someone learning Perl?
--
<URL: http://dev.scriptics.com/>
<URL: mailto:lvirden@cas.org> <URL: http://www.purl.org/NET/lvirden/>
Unless explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 2903
**************************************