[9868] in Perl-Users-Digest
Perl-Users Digest, Issue: 3461 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Aug 17 03:07:19 1998
Date: Mon, 17 Aug 98 00:00:29 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 17 Aug 1998 Volume: 8 Number: 3461
Today's topics:
arithmetic error... (GEMINI)
Re: arithmetic error... (Larry Rosler)
Re: Client-server sockets question. (Abigail)
Re: Client-server sockets question. (Martin Vorlaender)
Re: Docs for CGI.pm! dturley@pobox.com
file type suffix explanation docs? (Steven Barbash)
Re: here's an implementation of diff in perl <ljz@asfast.com>
Re: here's an implementation of diff in perl (Mark-Jason Dominus)
Re: here's an implementation of diff in perl (Lloyd Zusman)
Re: here's an implementation of diff in perl (Abigail)
Re: How can I place STDIN in my script? <nguyend7@msu.edu>
Re: Perl's equiv of "cc -DDEBUG" ? (Tomoyuki Tanaka)
Re: Perl's equiv of "cc -DDEBUG" ? (Abigail)
Re: Perl's equiv of "cc -DDEBUG" ? (Andrew M. Langmead)
Re: Perl's equiv of "cc -DDEBUG" ? (Ilya Zakharevich)
Re: perl5 large integer conversion bug <jaakko@hyvatti.iki.fi>
Re: Pretty HTML-izing of Perl source? <elflord@pegasus.rutgers.edu>
Re: Print Buffer order problem (Tad McClellan)
Re: Print Buffer order problem (Larry Rosler)
Re: Q: How to read all the file name in a directory (Andrew M. Langmead)
Re: Q: How to read all the file name in a directory (I R A Aggie)
Re: Q: How to read all the file name in a directory (I R A Aggie)
Re: Regular Expression (AND search) (Marc-A. Woog)
Re: taint checking seems to slow down my code (Larry Rosler)
Re: taint checking seems to slow down my code <rootbeer@teleport.com>
Re: taint checking seems to slow down my code (Mark-Jason Dominus)
Re: unlink files in directories with spaces (win95) (Martien Verbruggen)
Re: verify password (brian moore)
Re: verify password (Andrew M. Langmead)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 17 Aug 1998 03:02:17 GMT
From: dennis@info4.csie.nctu.edu.tw (GEMINI)
Subject: arithmetic error...
Message-Id: <6r86fp$fo2$1@netnews.csie.NCTU.edu.tw>
hi all,
I have a program that using floating point number arithmetic.
However, I found some weird things about the int() function in the following
program:
$w=8300.25;
$s=83;
$g=0.025;
$a=($w*$s/10.0+$g)/($g*2);
print "a=$a\n";
$b=int($a);
print "b=$b\n";
-----------------------------
execution result:
a=1377842
b=1377841
since $a has the integer portion of 1377842,
then $b should be equal to 1377842 as $b=int($a),
but the result of $b is 1 less than $a
if I modify the expression to be $a=($w*($s/10.0)+$g)/($g*2);
(having the $s divided first).
then run again:
a=1377842
b=1377842
the result is OK.
so what's the matter with int()?
the same argument will produce different results?
could anybody explain this?
thanks.
------------------------------
Date: Sun, 16 Aug 1998 20:25:13 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: arithmetic error...
Message-Id: <MPG.104142733d81b3f49897d4@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and copy mailed.]
In article <6r86fp$fo2$1@netnews.csie.NCTU.edu.tw> on 17 Aug 1998
03:02:17 GMT, GEMINI <dennis@info4.csie.nctu.edu.tw> says...
...
> $w=8300.25;
> $s=83;
> $g=0.025;
> $a=($w*$s/10.0+$g)/($g*2);
> print "a=$a\n";
>
> $b=int($a);
> print "b=$b\n";
> -----------------------------
> execution result:
> a=1377842
> b=1377841
...
> so what's the matter with int()?
> the same argument will produce different results?
> could anybody explain this?
Readily. Nothing is the matter with int(), just with your use of it.
You should do two things:
1. printf "%.20f\n", $a;
2. Read the first entry in perlfaq4 (but not the version still on CPAN):
"Why am I getting long decimals (eg, 19.9499999999999) instead of the
numbers I should be getting (eg, 19.95)?"
which, while not directly answering your question, will enhance your
understanding of the problem.
--
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 17 Aug 1998 02:15:56 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Client-server sockets question.
Message-Id: <6r83os$c51$2@client3.news.psi.net>
Jose (intermidi@mx2.redestb.es) wrote on MDCCCXI September MCMXCIII in
<URL: news:35d76ce9.0@news.arrakis.es>:
++
++ I have a long URL list to verify, looking for broken ones.
use LWP::UserAgent;
Abigail
--
perl -MNet::Dict -we '(Net::Dict -> new (server => "dict.org")\n-> define ("foldoc", "perl")) [0] -> print'
------------------------------
Date: Mon, 17 Aug 1998 04:29:05 +0200
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: Client-server sockets question.
Message-Id: <35d79571.524144494f47414741@radiogaga.harz.de>
Jose (intermidi@mx2.redestb.es) wrote:
: I have a long URL list to verify, looking for broken ones.
: I don't know sockets, but i found on the net some samples. So, i built a
: little program to verify one URL, but it returns 'HTTP/1.1 403 Forbidden'.
: The requested URL is http://www.eliana.com, but if i request
: http://www.yahoo.com, it works ok ('HTTP/1.1 200').
Why, you're getting a response, don't you?
Seems that access to that page isn't open any longer.
cu,
Martin
--
| Martin Vorlaender | VMS & WNT programmer
OpenVMS: Where do you | work: mv@pdv-systeme.de
want to BE today? | http://www.pdv-systeme.de/users/martinv/
| home: martin@radiogaga.harz.de
------------------------------
Date: Mon, 17 Aug 1998 01:14:43 GMT
From: dturley@pobox.com
Subject: Re: Docs for CGI.pm!
Message-Id: <6r8063$v0h$1@nnrp1.dejanews.com>
In article <6r5p0d$80p$1@nnrp1.dejanews.com>,
powerfactor@hotmail.com wrote:
> Hi,
> Where can I find some documentation about the CGI.pm?
>
They come with CGI.pm. You can find them ont he same computer to which you
downloaded CGI.pm.
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Mon, 17 Aug 1998 00:16:30 -0300
From: stevenba@carr.org (Steven Barbash)
Subject: file type suffix explanation docs?
Message-Id: <MPG.104178ac89b63633989681@www-private.alaskapermfund.com>
What are (or where can I find explanations for) file suffixes used by
Perl? .pm, .pl, .pod ...
What do they mean?
Thanks.
Steve Barbash
------------------------------
Date: 16 Aug 1998 22:39:49 -0400
From: Lloyd Zusman <ljz@asfast.com>
Subject: Re: here's an implementation of diff in perl
Message-Id: <ltu33c9vre.fsf@asfast.com>
abigail@fnx.com (Abigail) writes:
> Mark-Jason Dominus (mjd@op.net) wrote on MDCCCXI September MCMXCIII in
> <URL: news:6r5vaa$2nt$1@monet.op.net>:
> ++
> ++ Ilya Zakharevich (ilya@math.ohio-state.edu) wrote on MDCCCX September
> ++ MCMXCIII in <URL: news:6r4lus$2as$1@mathserv.mps.ohio-state.edu>:
> ++ >++ I do not need to know the degree of
> ++ >++ difference, only the fact that the lines are different.
> ++
> ++ In article <6r5c60$5q8$2@client3.news.psi.net>,
> ++ Abigail <abigail@fnx.com> wrote:
> ++ >I fail to see how you can know two
> ++ >lines the same without somehow involving all characters.
> ++
> ++ Aren't you being obtuse here? Obviously you can't know that they are
> ++ the same without looking at all the characters. But you can certainly
> ++ know that they're different without looking at all the characters.
>
>
> Uhm, as far as I know, 2 strings are either different, or the same.
> And while it's true that in certain cases you don't have to look at all
> characters to see that 2 strings are different, in the worst case you
> do. Particulary in the case when you report "no difference".
Yes. And for a given pair of lines, sometimes you'll find them to be
different after only a few characters are compared ... and sometimes
after almost all the characters in the lines are compared ... and
sometimes they will be exactly equivalent. Therefore, for any two
lines of size N, there will be an an average of N/2 comparisons needed
to determine whether or not they are equivalent. O(N) is not
generally considered to be meaningfully larger than O(N/2).
And besides, given that `diff' is generally used in a case where most
of the lines are expected to compare as equivalent, we can expect that
in the typical case, the portion of the algorithm that compares
individual lines will be much closer to O(N) than O(N/2).
--
Lloyd Zusman ljz@asfast.com
perl -e '$n=170;for($d=2;($d*$d)<=$n;$d+=(1+($d%2))){for($t=0;($n%$d)==0;
$t++){$n=int($n/$d);}while($t-->0){push(@r,$d);}}if($n>1){push(@r,$n);}
$x=0;map{$x+=(($_>0)?(1<<log($_-0.5)/log(2.0)+1):1)}@r;print"$x\n"'
------------------------------
Date: 16 Aug 1998 23:50:30 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: here's an implementation of diff in perl
Message-Id: <6r89a6$6mv$1@monet.op.net>
In article <ltu33c9vre.fsf@asfast.com>, Lloyd Zusman <ljz@asfast.com> wrote:
>Therefore, for any two lines of size N, there will be an an average
>of N/2 comparisons needed to determine whether or not they are
>equivalent.
On any given day, you wither win the lottery or you don't. Therefore,
on average, in any set of N days, you will win the lottery N/2 times.
> O(N) is not generally considered to be meaningfully larger than O(N/2).
O(N) is identical to O(N/2).
------------------------------
Date: 17 Aug 1998 04:37:07 GMT
From: ljz@asfast.com (Lloyd Zusman)
Subject: Re: here's an implementation of diff in perl
Message-Id: <slrn6tfct7.nka.ljz@sunspot.tiac.net>
On 16 Aug 1998 23:50:30 -0400, Mark-Jason Dominus <mjd@op.net> wrote:
>
> In article <ltu33c9vre.fsf@asfast.com>, Lloyd Zusman <ljz@asfast.com> wrote:
> >Therefore, for any two lines of size N, there will be an an average
> >of N/2 comparisons needed to determine whether or not they are
> >equivalent.
>
> On any given day, you wither win the lottery or you don't. Therefore,
> on average, in any set of N days, you will win the lottery N/2 times.
Yes ... good point. I stand corrected.
There are lots of ways that two lines can differ, but only one way
that they can be identical. Given the possible set of characters that
could fill each of the N positions of the lines, there is a very high
probability that any two arbitrary lines will not match, and there is
also a very good chance that this non-matchingness will be detected
after a small number characters of the two lines have been compared.
> [ ... ]
--
Lloyd Zusman 01234567 <-- The world famous Indent-o-Meter.
ljz@asfast.com ^ Indent or be indented.
------------------------------
Date: 17 Aug 1998 05:33:45 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: here's an implementation of diff in perl
Message-Id: <6r8fbp$dvt$1@client3.news.psi.net>
Lloyd Zusman (ljz@asfast.com) wrote on MDCCCXII September MCMXCIII in
<URL: news:ltu33c9vre.fsf@asfast.com>:
++
++ Yes. And for a given pair of lines, sometimes you'll find them to be
++ different after only a few characters are compared ... and sometimes
++ after almost all the characters in the lines are compared ... and
++ sometimes they will be exactly equivalent. Therefore, for any two
++ lines of size N, there will be an an average of N/2 comparisons needed
++ to determine whether or not they are equivalent.
No, that would be the case if the lines would differ in just one character.
++ O(N) is not
++ generally considered to be meaningfully larger than O(N/2).
The classes of functions that are O(N) and that are O(N/2) are identical.
++ And besides, given that `diff' is generally used in a case where most
++ of the lines are expected to compare as equivalent, we can expect that
++ in the typical case, the portion of the algorithm that compares
++ individual lines will be much closer to O(N) than O(N/2).
I think you don't truly understand big-Oh.
Abigail
--
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'
------------------------------
Date: 17 Aug 1998 01:03:37 GMT
From: Dan Nguyen <nguyend7@msu.edu>
Subject: Re: How can I place STDIN in my script?
Message-Id: <6r7vh9$f94$1@msunews.cl.msu.edu>
drsean1@my-dejanews.com wrote:
: Hi everyone, I have a script where I want to take <STDIN> input and place it
: as a part of my script. Here it is:
: $variable = "Hello";
: $line = <STDIN>;
: print ("$line world");
: The input I want to send to STDIN is:
: $variable
Try this
print "$variable world";
Don't worry about STDIN, because your not recieving any data from
outside of the program.
--
Dan Nguyen | There is only one happiness in
nguyend7@msu.edu | life, to love and be loved.
http://www.cse.msu.edu/~nguyend7 | -George Sand
------------------------------
Date: 17 Aug 1998 00:53:41 GMT
From: ez074520@dilbert.ucdavis.edu (Tomoyuki Tanaka)
Subject: Re: Perl's equiv of "cc -DDEBUG" ?
Message-Id: <6r7uul$9l5$1@mark.ucdavis.edu>
does the following work?
in the Perl code i'd have
# /*
[print stuff for debugging]
# */
when i want the debug stuff printed, i'd do "perl ..."
when i want the debug stuff suppressed, i'd do "perl -P ..."
would this work?
In article <6r7uae$3ql$3@client3.news.psi.net>,
Abigail <abigail@fnx.com> wrote:
>++ >
>++ >> what's Perl's equiv of "cc -DDEBUG" ?
>++ >>
>++ >> where in the C code you'd have
>++ >>
>++ >> #ifdef DEBUG
>++ >> [print stuff]
>++ >> #endif
>++ >>
>++ >
>++ >There isn't one.
>++
>++ Actually, there is one. See the -P switch in perldoc perlrun.
>
>But that doesn't help you much. Without the -P switch, #ifdef DEBUG
>is just a comment, and perl *will* execute the commands you don't
>want to be executed. And using #ifndef doesn't help anything either.
>
>-P turns on C preprocessing - but it doesn't do -D command line
>switches. (Perl has -D, but that's for something completely different)
>
------------------------------
Date: 17 Aug 1998 02:10:01 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Perl's equiv of "cc -DDEBUG" ?
Message-Id: <6r83dp$c51$1@client3.news.psi.net>
Tomoyuki Tanaka (ez074520@dilbert.ucdavis.edu) wrote on MDCCCXII
September MCMXCIII in <URL: news:6r7uul$9l5$1@mark.ucdavis.edu>:
++
++ does the following work?
++
++ in the Perl code i'd have
++ # /*
++ [print stuff for debugging]
++ # */
++
++ when i want the debug stuff printed, i'd do "perl ..."
++ when i want the debug stuff suppressed, i'd do "perl -P ..."
++
++ would this work?
What happened when you tried?
Abigail
--
perl -MNet::Dict -we '(Net::Dict -> new (server => "dict.org")\n-> define ("foldoc", "perl")) [0] -> print'
------------------------------
Date: Mon, 17 Aug 1998 04:20:44 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Perl's equiv of "cc -DDEBUG" ?
Message-Id: <ExtG2L.6uM@world.std.com>
ez074520@dilbert.ucdavis.edu (Tomoyuki Tanaka) writes:
> what's Perl's equiv of "cc -DDEBUG" ?
> where in the C code you'd have
> #ifdef DEBUG
> [print stuff]
> #endif
Since perl does not save its intermediate format, (unlike a C
compiler) thre is not a feature that is exactly like that. You can
make use of the "constant" pragma and the fact that perl optimizes
away invariant branches.
use constant DEBUG => 1;
if (DEBUG) {
# [ print stuff ]
}
But there is no clean way of overriding a constant with a different
value on the command line.
--
Andrew Langmead
------------------------------
Date: 17 Aug 1998 05:33:17 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Perl's equiv of "cc -DDEBUG" ?
Message-Id: <6r8fat$2ja$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Abigail
<abigail@fnx.com>],
who wrote in article <6r7uae$3ql$3@client3.news.psi.net>:
> ++ Actually, there is one. See the -P switch in perldoc perlrun.
>
> But that doesn't help you much. Without the -P switch, #ifdef DEBUG
> is just a comment, and perl *will* execute the commands you don't
> want to be executed. And using #ifndef doesn't help anything either.
>
> -P turns on C preprocessing - but it doesn't do -D command line
> switches. (Perl has -D, but that's for something completely different)
Even without -D you can write
#ifdef DEBUG
print "Doing debugging";
#endif
- and run with -P for non-debugging case. ;-)
Ilya
------------------------------
Date: 17 Aug 1998 03:00:43 -0000
From: Jaakko Hyvdtti <jaakko@hyvatti.iki.fi>
Subject: Re: perl5 large integer conversion bug
Message-Id: <6r86cr$gjo@mansikka.eunet.fi>
Tom Christiansen <tchrist@mox.perl.com> wrote:
>In comp.lang.perl.misc, ilya@math.ohio-state.edu (Ilya Zakharevich) writes:
>:Oh, stop this, Tom! People expect that Perl numbers behave as, well,
>:numbers.
>
>Bit patterns are not numbers. What's 2 & 3.4? What's -1 | 1?
>What's O_RDWR|O_CREAT?
That is not the point, the bit operator works exactly as expected,
but anything after it does not:
$s = "3000000000";
print $s | 1, "\n";
print $s + 1, "\n";
prints out:
3000000001
-1294967295
but if done in different order:
$s = "3000000000";
print $s + 1, "\n";
print $s | 1, "\n";
print $s + 1, "\n";
it works:
3000000001
3000000001
3000000001
--
Jaakko.Hyvatti@iki.fi http://www.iki.fi/hyvatti/ +358 40 5011222
echo 'movl $36,%eax;int $128;movl $0,%ebx;movl $1,%eax;int $128'|as -o/bin/sync
------------------------------
Date: Sun, 16 Aug 1998 22:44:32 -0400
From: Donovan Rebbechi <elflord@pegasus.rutgers.edu>
Subject: Re: Pretty HTML-izing of Perl source?
Message-Id: <35D7990F.F978730F@pegasus.rutgers.edu>
Corbett J. Klempay wrote:
>
> Hi there..I'm wondering if anyone is aware of (and can point me to) any
> tools (probably in Perl themselves, I'd assume) that, given Perl source,
> output pretty HTML files (syntax highlighted, basically). I have seen a
vim is a text editor that includes syntax highlighting for basically
everything, which of course includes perl. (note that you need vim >= 5
to do this)
It cones with a tool that allows you to get html output of a vim session
(it renders the colours properly , etc ).
Check out my vim page
http://pegasus.rutgers.edu/~elflord/vim/
for some sample shots (bash scripts and build scripts)
you can get vim from http://www.vim.org
--
Donovan Rebbechi <elflord@pegasus.rutgers.edu>
http://pegasus.rutgers.edu/~elflord/
Web designer for Independence -- Linux for the Masses
http://www.independence.seul.org/
------------------------------
Date: Sun, 16 Aug 1998 20:33:23 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Print Buffer order problem
Message-Id: <4918r6.23p.ln@metronet.com>
Peter J. Elfman (elf@efga.org) wrote:
: Here is my code:
: print "Content-type: text/html\n\n";
: print "\n";
: system(@args);
: print "\n hello\n\n";
: The output from the system command prints first, not second. Then the
: Content-type header, then the hello. How do I make it all show up in
: the proper order?
Look up the $/ variable in the perlvar man page.
: (I think the answer is on page 130 of the 2nd edition Programming Perl
: book (llama), but I don't know how to put it into code :)
Programming Perl is the Camel.
Learning Perl is the Llama.
I'm not gonna go look at page 130 in both of them to find out
which you really meant...
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 16 Aug 1998 23:05:56 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Print Buffer order problem
Message-Id: <MPG.10416822ce5905b9897d5@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and copy mailed.]
In article <4918r6.23p.ln@metronet.com> on Sun, 16 Aug 1998 20:33:23 -
0500, Tad McClellan <tadmc@metronet.com> says...
...
> : The output from the system command prints first, not second. Then the
> : Content-type header, then the hello. How do I make it all show up in
> : the proper order?
>
>
> Look up the $/ variable in the perlvar man page.
Er, umm, $|. Off by only 45 degrees or so. :-)
--
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Mon, 17 Aug 1998 03:47:26 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Q: How to read all the file name in a directory
Message-Id: <ExtEJ2.GLt@world.std.com>
Grant Griffin <grant.griffin@iowegian.com> writes:
>I still can't figure out why Tom C., who is the World's Greatest
>Advocate of The World's Most Portable Language regrets it so much when
>somebody runs it on something other than Unix!
Maybe because Tom sees the language more like the "Portable
distillation of Unix" described in the Camel than the "Most Portable
Language" that you see it as.
Perl was orignally designed to be portable accross *all flavors of
Unix*. It came with a bourne shell script that tested all the little
nooks and cranies that different versions of Unix (uhm) differed.
But then a lot of people saw that they could take this flexibility a
bit farther. Depending on how much their system acted like Unix, or
how much code their were willing to write to make it so, (read that as
"Thank you Matthias for the GUSI library") they could have a great
Unix-like tool for their system.
It could be that perl's success is a nod of approval to the unix
paradigm that it didn't get from the OS marketplace. But on the other
hand, it isn't very surprising. Unix has always been hailed as a great
devloper's environment, and developers onother operating systems
realized the utility of perl.
>In an ideal world, any given gizmo would be so easy to use that nobody
>would _have to_ read the manual! (Not that Windows is even remotly
>_close_ to that goal.) For example, I just bought a new car. Do I want
>to read the manual? No. Did I have to? Yes. The people who designed
>the car screwed up.
The difference is, you use a programming laanguage to build something,
not to use by itself. I hope the people who built your car read the
manuals.
--
Andrew Langmead
------------------------------
Date: Sun, 16 Aug 1998 20:00:15 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Q: How to read all the file name in a directory
Message-Id: <fl_aggie-1608982000150001@aggie.coaps.fsu.edu>
In article <ltiujsbml2.fsf@asfast.com>, Lloyd Zusman <ljz@asfast.com> wrote:
+ fl_aggie@thepentagon.com (I R A Aggie) writes:
+ > Ummm...if sarcasm where posted to the net, would anyone notice?
+ Perhaps I erred in my reasoning.
Well, yes. My reasoning goes thusly:
1. the previous poster's claim was that it's rude to hurt someone's feelings
2. the previous poster claims he will begin to scorn TomC with silence
Ergo, the previous poster is being rude, and is engaging in the same
behaviour that he decries.
So, Lloyd, how's the Perl Helpdesk going?
James
------------------------------
Date: Sun, 16 Aug 1998 19:57:11 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Q: How to read all the file name in a directory
Message-Id: <fl_aggie-1608981957120001@aggie.coaps.fsu.edu>
In article <6r771u$519@mozo.cc.purdue.edu>, gebis@fee.ecn.purdue.edu
(Michael J Gebis) wrote:
+ If you become a barbarian to defeat the barbarians, you've already
+ lost.
In which case, why are you still on Usenet? Spammers have already
accomplished what you speak of...
James
------------------------------
Date: Sun, 16 Aug 1998 16:33:15 GMT
From: mwoog@pobox.ch (Marc-A. Woog)
Subject: Re: Regular Expression (AND search)
Message-Id: <35d7098c.4412803@news.datacomm.ch>
On 15 Aug 1998 15:11:52 GMT, "Duncan Cameron" <dcameron@bcs.org.uk>
wrote:
>Hmm...
>See the FAQ "How do I efficiently match many regular expressions at once?"
>HTH
>Marc-A. Woog <mwoog@pobox.ch> wrote in article
><35d69a1a.778577@news.datacomm.ch>...
>> Hi there,
>> I am new to this group and actually I am newbie to Perl. So please
>> forgive me, if my question is somewhere in the FAQ (where is it?) or
>> answered before.
>< remainder snipped>
Hmmm...Just stomped right in the Newbie Trap, haven't I? Thanks for
the help anyway. It works fine but I don't understand why...
Marc
--
Marc-A. Woog
mwoog@pobox.ch
http://www.geocities.com/SouthBeach/Sands/2413
------------------------------
Date: Sun, 16 Aug 1998 18:28:36 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: taint checking seems to slow down my code
Message-Id: <MPG.1041271c6aefaef59897d2@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and copy mailed.]
In article <6r7it1$eg2$1@nnrp1.dejanews.com> on Sun, 16 Aug 1998 21:28:01
GMT, sneaker@fccj.org <sneaker@fccj.org> says...
> In article <6r6tfu$3bf$1@monet.op.net>,
> mjd@op.net (Mark-Jason Dominus) wrote:
> > In article <35D6D41D.B56E0C5D@sneex.fccj.org>,
> > Bill 'Sneex' Jones <bill@fccj.org> wrote:
...
> > >Who started this whole setuid thing anyways?
> >
> > Dennis.
>
> Do'Oh! I forgot about that C thing :]
Much more likely that it was Ken re Unix rather than Dennis re C.
'setuid' has no more to do with C than it has to do with Perl, namely,
nothing.
--
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Mon, 17 Aug 1998 02:27:23 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: taint checking seems to slow down my code
Message-Id: <Pine.GSO.4.02A.9808161922400.28707-100000@user2.teleport.com>
On Sun, 16 Aug 1998 aspeer@my-dejanews.com wrote:
> If run from a shell, the code will process about 140 log lines per
> second. If I run the program setuid, the speed drops to about 80 log
> lines per second. I presume this is because the taint checker is
> checking *every* hash variable *every* time I use it.
Such a significant slowdown is surprising; I'm a little skeptical. If you
use the -T option but don't run set-id, do you see the same slowdown? If
so, I wonder whether your algorithm couldn't be improved some. Taint
checking has some overhead, but it shouldn't be a 75% increase, in most
cases. Good luck with it!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 16 Aug 1998 23:44:16 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: taint checking seems to slow down my code
Message-Id: <6r88ug$6kq$1@monet.op.net>
In article <MPG.1041271c6aefaef59897d2@nntp.hpl.hp.com>,
Larry Rosler <lr@hpl.hp.com> wrote:
>Much more likely that it was Ken re Unix rather than Dennis re C.
Maybe more likely, but wrong. You are perpetrating a false dichotomy here:
1. Ken re Unix
2. Dennis re C
However, there is a third option:
3. Dennis re Unix
This is the correct one.
U.S. patent #4,135,240 is the setuid patent,
and it is held by Dennis Ritchie.
------------------------------
Date: 17 Aug 1998 02:40:14 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: unlink files in directories with spaces (win95)
Message-Id: <6r856e$5ks$1@nswpull.telstra.net>
In article <ExMtIv.8ME@world.std.com>,
aml@world.std.com (Andrew M. Langmead) writes:
> I've always thought that the best thing to do is to avoid globbing and
> use opendir/readdir/closedir instead.
Agreed, but you need to make sure you do it correctly.
> opendir DIR 'c:/tmp/hello world' or die;
> unlink readdir DIR;
> closedir DIR;
Of course, you need to make sure in this case that your working
directory is actually c:/tmp, or you might end up unlinking files
somewhere else. It doesn't hurt to check the return value of unlink
either.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | "In a world without fences,
Commercial Dynamics Pty. Ltd. | who needs Gates?"
NSW, Australia |
------------------------------
Date: 17 Aug 1998 02:34:53 GMT
From: bem@news.cmc.net (brian moore)
Subject: Re: verify password
Message-Id: <slrn6tf5mn.tth.bem@thorin.cmc.net>
On 15 Aug 1998 16:22:46 GMT,
tigger@io.nospaam.com <tigger@io.nospaam.com> wrote:
> Tom Phoenix <rootbeer@teleport.com> spewed forth with:
> > On Sat, 15 Aug 1998, Craig Nuttall wrote:
>
> >> My problem is that I can't seem to get the script to run as root,
>
> > On some systems, the kernel doesn't allow set-id scripts. In that case,
> > Perl should (almost certainly) be compiled to make that possible. Hope
> > this helps!
>
>
> Actually, the kernel *has* to allow setuid scripts to work, or your
> /bin/passwd program would never work.
Scripts are not binaries. MANY systems do not allow the #! magic
sequence to invoke a script for security reasons. (In short, there is a
race condition that would allow replacing the program with an arbitrary
script, which would be a bad thing.)
/bin/passwd is a binary, not a script and isn't subject to that race
condition.
man perlsec for more info and note th 'Security Bugs' section.
--
Brian Moore Kill A Spammer For Jesus
Sysadmin, C/Perl Hacker, Usenet Vandal
------------------------------
Date: Mon, 17 Aug 1998 03:58:02 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: verify password
Message-Id: <ExtF0q.KAD@world.std.com>
tigger@io.nospaam.com writes:
>Actually, the kernel *has* to allow setuid scripts to work, or your /bin/passwd
>program would never work.
The program "/bin/passwd" is most likely a compiled program, not a
script.
The method of opening and reading a file to determine the name of the
compiled executable to run and then passing the name of that file as
an argument to be open and parsed creates a race condition. This is
why many systems ignore the setuid bits on files with the "#!" magic
number. It doesn't mean that the OS does not have the setuid facility
at all.
--
Andrew Langmead
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 3461
**************************************