[9509] in Perl-Users-Digest
Perl-Users Digest, Issue: 3103 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jul 9 02:07:26 1998
Date: Wed, 8 Jul 98 23:00:19 -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 Wed, 8 Jul 1998 Volume: 8 Number: 3103
Today's topics:
Re: -- Abigail, A FIX to the space problem. (Tad McClellan)
Re: -w on production code (was Re: better way of gettin (Abigail)
Re: -w on production code (was Re: better way of gettin (Ronald J Kimball)
Re: -w on production code (was Re: better way of gettin <ljz@asfast.com>
Re: -w on production code (was Re: better way of gettin <ljz@asfast.com>
Re: -w on production code (was Re: better way of gettin (Craig Berry)
Re: 2 dimensional array - Help needed <blok@physics.ubc.ca>
Re: 2 dimensional array - Help needed (Ronald J Kimball)
Re: Abigail - Another Question for you. (Ronald J Kimball)
Re: Asking for some info for a beginner, Please read i (Tad McClellan)
Re: Asking for some info for a beginner, Please read i (Ronald J Kimball)
Re: Do I understand this? <ryan@steelplan.com.au>
Re: Help: testing cgi's locally (Doug Perry a.k.a drperry)
Re: Mix Perl and HTML? (brian moore)
Re: new charter and moderator for comp.lang.perl.announ (brian moore)
outputting expanded variables in strings <michael@mail.warpone.net>
Re: Pattern matching problems (Ronald J Kimball)
Re: Perl CGI and warnings [Was: Re: -w on production co (Tad McClellan)
Re: Perl CGI and warnings [Was: Re: -w on production co (Ilya Zakharevich)
setuid root & failed system call <mike.schleif@aquila.com>
Re: Splitting a difficult CSV file (Tad McClellan)
Re: tough regexp - help needed (Abigail)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 8 Jul 1998 22:30:26 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: -- Abigail, A FIX to the space problem.
Message-Id: <igd1o6.uk8.ln@localhost>
Webcruiser (dfsdf@ziplink.net) wrote:
: OK. I figured out that the html form doesn't like the @STATUS array. I
: changed the form to use $STATUS instead. As far as reading the file from
: the disk, I use the standard @STATUS = <FILE>, then I flatten the array
: to a scaler variable as follows:
: $numlines=@STATUS; # determine the number of lines in the array
: $STATUS=""; # clear out $STATUS
: for ($x=0; $x<=$numlines; $x++){
: $STATUS = "$STATUS$STATUS[$x]"; # Build the $STATUS string
: }
Whew!
Do you get paid by the keystroke or something? ;-)
$STATUS = join '', @STATUS; # replaces _all_ of the above code...
Or, since you (now) want all of the file in a single scalar:
{ local $/;
$STATUS = <FILE>; # upper case variable names are yukky though...
}
: Thanks again to all who contributed to my problem (Tom & Tad).
I'm disappointed.
All this time I thought I was contributing to *solutions*... ;-)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 9 Jul 1998 04:05:48 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: -w on production code (was Re: better way of getting the last modified file?)
Message-Id: <6o1fis$6lf$3@client3.news.psi.net>
Lloyd Zusman (ljz@asfast.com) wrote on MDCCLXXIII September MCMXCIII in
<URL: news:ltemvv7pfn.fsf@asfast.com>:
++
++ Inserting a `my $opt_a;' prior to the `getopts' call definitely
++ eliminated the warning message for me. I didn't post my previous
++ message until I tested that case ... and yes, I did keep the `-w'
++ flag during that test.
$ cat >> test.pl
#!/usr/local/bin/perl -w
use Getopt::Std;
my $opt_a;
unless (Getopt::Std::getopts('a')) {
die "usage: $0 [ -a ] ...\n";
}
if (defined $opt_a) {
print "\$opt_a defined!\n";
}
else {
print "\$opt_a NOT defined\n";
}
__END__
^D
$ chmod +x test.pl
$ perl -wc test.pl
test.pl syntax OK
$ ./test.pl -a 1
$opt_a NOT defined
$
Indeed. No warning. But the program isn't working properly.
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=new Math::BigInt+qq;$^F$^W783$[$%9889$^F47$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W98$^F76777$=56;;$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V%$^U;$^V/=$^U}while$^V!=$^W'
------------------------------
Date: Thu, 9 Jul 1998 00:08:53 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: -w on production code (was Re: better way of getting the last modified file?)
Message-Id: <1dbvfl9.13qd4xj1fj1ejyN@bay2-44.quincy.ziplink.net>
Tom Christiansen <tchrist@mox.perl.com> wrote:
> Please don't let Randal set a bad example for any of you.
After all, Tom needs to have a purpose on clpm. ;-)
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: 09 Jul 1998 00:19:05 -0400
From: Lloyd Zusman <ljz@asfast.com>
Subject: Re: -w on production code (was Re: better way of getting the last modified file?)
Message-Id: <lt3ecb7j2e.fsf@asfast.com>
On NPGE - IV, "Michael D. Schleif" <mike.schleif@aquila.com> writes:
> Wow!
>
> This is really the coolest thread in quite sometime!
>
> Let me toss this bone to the wolves:
>
> If "-w" and "use strict" were compiled-in-standard in Perl, how would
> that affect the postings to clpm? What would change here?
That's indeed food for thought, and here's some more: if `-w' and
`use strict' were defaults, and if each warning or error message
that printed out also contained the following text, what affect would
*this* have on c.l.p.m. postings? ...
"... and if you're one of those `newbies', don't even *think* of
posting any questions to comp.lang.perl.misc until you've read
the Perl FAQs, which can be found at http://language.perl.com/faq/,
among other places ..."
I shudder to contemplate the consequences if someone actually takes
this idea seriously.
Thank God for c.l.p.moderated.
--
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: 09 Jul 1998 00:44:00 -0400
From: Lloyd Zusman <ljz@asfast.com>
Subject: Re: -w on production code (was Re: better way of getting the last modified file?)
Message-Id: <ltww9n63cf.fsf@asfast.com>
abigail@fnx.com (Abigail) writes:
> Lloyd Zusman (ljz@asfast.com) wrote on MDCCLXXIII September MCMXCIII in
> <URL: news:lthg0r7sln.fsf@asfast.com>:
> ++
> ++ Consider the following fairly typical usage of the Getopt::Std module:
> ++
> ++ #!/usr/bin/perl -w
> ++ # -*- perl -*-
> ++
> ++ ($program = $0) =~ s:^.*/::;
> ++
> ++ use Getopt::Std;
> ++
> ++ unless (Getopt::Std::getopts('a')) {
> ++ die "usage: $program [ -a ] ...\n";
> ++ }
> ++
> ++ if (defined($opt_a)) {
> ++ handleOptionA();
> ++ }
> ++
> ++ This generates the following warning under `-w':
> ++
> ++ Name "main::opt_a" used only once: possible typo at testscript line 12.
>
> use vars qw /$opt_a/;
>
> Needed anyway, because you want 'use strict;' too!
I do? Sure, if I put in `-w' and `use strict;', then I get two
warnings *and* the script won't run. If I leave them out, then the
script runs perfectly well as written above. And nothing dangerous
happens.
Keep in mind that I'm not saying that `-w' and `use strict;' are bad
things. On the contrary: I consider them to be very useful and
worthwhile tools to employ.
It's just that after reading and participating in this thread, I have
come to the conclusion that every now and then one might encounter a
case where it's actually advantageous to leave these two constructs
out of one's production code.
> ++ Of course I could make this warning go away by strategically inserting
> ++ a `my $opt_a;', or by making use of the second, hash-reference
>
> No... my $opt_a would be wrong. There's no way Getopt::Std is touching
> your lexicals.
You're quite right. I should have used `local' instead of `my'.
--
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: 9 Jul 1998 05:45:15 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: -w on production code (was Re: better way of getting the last modified file?)
Message-Id: <6o1ldb$5n4$1@marina.cinenet.net>
Michael D. Schleif (mike.schleif@aquila.com) wrote:
: If "-w" and "use strict" were compiled-in-standard in Perl, how would
: that affect the postings to clpm? What would change here?
Just possibly, some questions would not get asked, as people would be
forced to see the warnings explaining why their programs aren't behaving
as they expect. Conversely, depending on your ambient cluefulness
estimate, the questions might instead simply transogrify into "Why am I
getting this warning?".
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: Wed, 08 Jul 1998 20:48:23 -0700
From: Rik Blok <blok@physics.ubc.ca>
To: Huang <wong2020@tm.net.my>
Subject: Re: 2 dimensional array - Help needed
Message-Id: <35A43D87.7AA2BDEA@physics.ubc.ca>
Huang:
I had the exact same problem. Here's my solution for Perl 5.
(I'm new to Perl (3 days) so I'm not sure how clean/efficient
this code is, but it seems to do the job...
------------- begin cut ----------------
# ReadData.pl - reads a data file (ASCII file)
# and returns the data as an array.
sub ReadData
# usage: @ReturnArray = ReadData($file,$colsep, $commentch,@usecols)
#
# note: if $colsep includes an escape sequence then be sure to use
single
# quotes when calling ReadData() so that the backslash doesn't get
# expanded prematurely (eg. @dat = ReadData("ugh.dat", '\s+',"#",1,2); )
{
# parameters
my $file = shift @_; # name of file to read
my $colsep = shift @_; # column separator (eg. '\s+' for one
# or more whitespaces)
my $commentch = shift @_; # ignore everything after this comment
my @usecol = @_; # remaining parameters indicate columns # to
store (in order)
# local variables
local(*FILE); # file needs local because my doesn't
# work for filehandles
my $line;
my @col;
my @data;
my $lineno = 0;
my $lastcol = $usecol[0];
my $i;
open FILE, $file or die "ReadData: Could not open data file $file:
\n$!";
# require all columns to exist: find last column in @usecol
for $i (1..$#usecol) { # can skip $usecol[0]
$lastcol = $usecol[$i] > $lastcol ? $usecol[$i] : $lastcol;
}
while ($line = <FILE>) { # while line successfully read
$line = $line.$commentch; # trick: append $commentch so it # is
always matched
$line=~/.*$commentch/; # find $commentch
$line = $`; # and keep everything before it
@col = split(/$colsep/,$line); # split by $colsep
# only process line if all necessary columns found
if (scalar(@col) >= $lastcol) {
for $i (0..$#usecol) {
$data[$i][$lineno] = $col[$usecol[$i]-1];
}
$lineno++;
}
}
close FILE;
return(@data); # return pointer to 2d array
}
return(1); # indicates file included properly
-------------- end cut -----------------
And here is a sample of how to use ReadData() :
------------- begin cut ----------------
# ReadDataTest.pl - tests ReadData.pl
require "ReadData.pl";
$fn = "C:/My Documents/GLAsynchPaper/064scale/64r.zip/64r01/s0.900.sps";
@dat = ReadData($fn,'\s+',"#",1,2);
$lastpoint = $#{$dat[0]};
for $i (0..$lastpoint) {
print "$dat[0][$i]\t$dat[1][$i]\n";
}
print "Done!\n";
<STDIN>;
-------------- end cut -----------------
Hope it helps!
Rik.
Huang wrote:
>
> Hi all:
>
> I have an input file with the following format
> 1 2 3
> 4 5 6
> 7 8 9
>
> I wish to input it into an array.
> The results I wish to accomplish is
> @x[1,1]=1
> @x[1,2]=2
> @x[3,1]=7
>
> I am not sure how Perl do it. I need help on this.
> Huang
> Thanks in advance.
--
Rik Blok <blok@physics.ubc.ca>
Department of Physics and Astronomy,
University of British Columbia, Canada
http://www.physics.ubc.ca/~blok/
------------------------------
Date: Thu, 9 Jul 1998 01:19:22 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: 2 dimensional array - Help needed
Message-Id: <1dbvjqe.1l84wo8i5n1pfN@bay2-44.quincy.ziplink.net>
Rik Blok <blok@physics.ubc.ca> wrote:
> I had the exact same problem. Here's my solution for Perl 5.
> (I'm new to Perl (3 days) so I'm not sure how clean/efficient
> this code is, but it seems to do the job...
You seem to be off to a good start. You do a lot of things right:
checking the return value of open, using my variables, etc.
A few comments...
> for $i (1..$#usecol) { # can skip $usecol[0]
> $lastcol = $usecol[$i] > $lastcol ? $usecol[$i] : $lastcol;
> }
for $col (@usecol) { # can skip $usecol[0], but ok not to :-)
$lastcol = $col if $col > $lastcol;
}
> while ($line = <FILE>) { # while line successfully read
while (defined($line = <FILE>)) {
Just in case the file ends with a zero on a line by itself and no
newline. :-)
> $line = $line.$commentch; # trick: append $commentch so it
> # is always matched
> $line=~/.*$commentch/; # find $commentch
> $line = $`; # and keep everything before it
If the line already contained a comment, you have just obliterated the
contents of $line. Consider: "foo # comment\n#" (with $commentch
already appended). /.*$commentch/ will match 'foo #' at the beginning
of the string, so $` is the null string.
If you want to strip comments, try this:
s/$commentch.*//;
By the way, $` and kin should be avoided, as they slow down every regex
in the script.
> return(@data); # return pointer to 2d array
You're actually returning the array itself, rather than a pointer. (And
Perl has references instead of pointers.) But you're probably just
mixing in C terminology.
> return(1); # indicates file included properly
1; # works too
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Thu, 9 Jul 1998 01:19:19 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Abigail - Another Question for you.
Message-Id: <1dbvjbi.4huxx81u2th0yN@bay2-44.quincy.ziplink.net>
Abigail (abigail@fnx.com) wrote:
> ++ > And
> ++ > $STATUS=@status[0];
> ++ > does something else than you think it does.
> ++ OK, what does this actually do?
>
> @status [0] is a slice, and it's evaluated in scalar context.
> Since it is a slice with one element, it evaluates to 1.
>
> $STATUS = 1; is a different way to write the above.
Hmm...
DB<1> @x = qw(a b c)
DB<2> $x = @x[0]
DB<3> x $x
0 'a'
DB<4> $x = @x[0..2]
DB<5> x $x
0 'c'
DB<6>
Nope.
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Wed, 8 Jul 1998 22:15:37 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Asking for some info for a beginner, Please read i really need some help here i so confused its not even funny
Message-Id: <pkc1o6.dj8.ln@localhost>
Calgary News (b1233@hotmail.com) wrote:
: Okay, i wanted to make a page that allows the user to enter data and then
: have that data added to another page that showed all the data from other
: people who have entered comments before them
: On this search to learn how to do this, i have been lead to cgi and then to
: perl, and now i am so messed up i have no idea which way is up
: what is perl, cgi, is there any place for dummies wanting to learn this
: language. i have used turbo pascal before, so i have some knowledge but i
: can't find a site that explains in detail every line so that i can write my
: own cgi and perl, and explains who these two work together
http://www.perl.com/perl/faq/idiots-guide.html
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 9 Jul 1998 01:19:25 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Asking for some info for a beginner, Please read i really need some help here i so confused its not even funny
Message-Id: <1dbvkis.sdq4qc4bfubqN@bay2-44.quincy.ziplink.net>
[posted and mailed]
Calgary News <b1233@hotmail.com> wrote:
> what is perl, cgi, is there any place for dummies wanting to learn this
> language. i have used turbo pascal before, so i have some knowledge but i
> can't find a site that explains in detail every line so that i can write my
> own cgi and perl, and explains who these two work together
How about a book?
CGI Programming on the World Wide Web
by Shishir Gundavaram
published by O'Reilly & Associates
might be a good place to start
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Thu, 9 Jul 1998 11:40:42 +0800
From: "Ryan Snowden" <ryan@steelplan.com.au>
Subject: Re: Do I understand this?
Message-Id: <6o1e8l$ign$1@news.iinet.net.au>
Well, Perl runs the world :)
Gabor wrote in message ...
|In comp.lang.perl.misc, Scratchie <upsetter@ziplink.net> wrote |# What
planet do you live on?
|What does that have to do with anything? And your perl question was?
------------------------------
Date: Thu, 09 Jul 1998 04:40:39 GMT
From: drperry@greennet.net (Doug Perry a.k.a drperry)
Subject: Re: Help: testing cgi's locally
Message-Id: <35a4477a.13050440@news.greennet.net>
On Tue, 07 Jul 1998 03:29:21 GMT, joker@inlink.com (John Hocking)
wrote:
# Previous text deleted out to save bandwith
I have been using Sambar Server for my local development and debugging
enviroment. A nice, full featured product and free for the taking. I
got mine from tucows, but it can also be found at www.sambar.com.
Handles perl scripts much better than the Micro$haft Personal Web
Server.
Another option is to install Linux along side Win95, the benefit is
that you'll get Apache HTTP server and EMACS as well as a better OS to
develop on.
------------------------------
Date: 9 Jul 1998 04:38:58 GMT
From: bem@news.cmc.net (brian moore)
Subject: Re: Mix Perl and HTML?
Message-Id: <slrn6q8ibd.e4k.bem@thorin.cmc.net>
On Wed, 08 Jul 1998 00:46:58 GMT,
Mickey Coulter <mcoulter@tampabay.rr.com> wrote:
> Is there a product, besides Verigen ($$$) that allows mixed Perl & HTML on
> UNIX? I am aware of IISPerl for Win32 and like it a LOT. Would like
> something similarly priced for UNIX ;-)
You mean you'd like to do something like:
[- $i = 0; @k = keys %ENV -]
[$ while ($i < $#k) $]
[+ $k[$i] +] = [+ $ENV{$k[$i]} +]<BR>
[- $i++ -]
[$ endwhile $]
Look at Embperl. It's free.
--
Brian Moore Kill A Spammer For Jesus
Sysadmin, C/Perl Hacker, Usenet Vandal
------------------------------
Date: 9 Jul 1998 04:31:45 GMT
From: bem@news.cmc.net (brian moore)
Subject: Re: new charter and moderator for comp.lang.perl.announce
Message-Id: <slrn6q8htr.e4k.bem@thorin.cmc.net>
On 8 Jul 1998 17:10:16 GMT,
Clinton Pierce <cpierce1@cp500.fsic.ford.com> wrote:
> I'd like clarification on this part.
>
> Our product contains 1% Perl code...may we advertize a new release on
> clpa? no? 50%! May we advertize now? If the Apache Project announces
> a new server with enhanced perl support features, does that warrant an
> announcement? Do they get a break 'cause they're in the free-source
> movement also? Would a commercial vendor (say, Netscape) get the same
> break?
>
> That part can get real ugly.
>
> Perhaps "commercial products which have perl as a focused part of the
> product: development libraries, unusual ports, extensions (such as GUIs),
> IDEs and debuggers."?
How about looking at it from the opposite side: have moderators that you
trust, and a charter that allows commercial posts if the moderator
concurs that the information is of value to the perl community?
This whole argument is sounding like nominating a Supreme Court judge
where issue-of-the-week is the deciding factor, not whether the person
has the wisdom to act wisely with unforseen cases.
(Which is what lead clpa to where it is: the charter forbade Randal
from using Wisdom to post things that should go there. Further
lets-write-an-all-encompasing-charter rules will lead to things not
being posted, even if it should be.)
--
Brian Moore Kill A Spammer For Jesus
Sysadmin, C/Perl Hacker, Usenet Vandal
------------------------------
Date: Wed, 8 Jul 1998 14:18:37 -0500
From: "Michael Lawhorne" <michael@mail.warpone.net>
Subject: outputting expanded variables in strings
Message-Id: <35a3c27a.0@194.250.238.3>
I am writing a script that will append mostly static data to a txt file
(there are about 5 dynamic changes each time). To do this I am using the
following method, taken from the perl faq:
$text = 'this has a $foo in it and a $bar';
$text =~ s/\$(\w+)/${$1}/g;
print OUTFILE $text;
This works fine, except for one problem- my $text string is pretty long, and
has 4 variables that need to be expanded. That works, but when it writes it
to a file it causes the text after each variable to begin on a new line,
even though I don't have any \n's in the string. Is there something that I
am missing that would make all of $text print on one line?
Thank you,
Michael Lawhorne
michael@midgard.cba.ua.edu
------------------------------
Date: Thu, 9 Jul 1998 00:08:57 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Pattern matching problems
Message-Id: <1dbvgrb.17nnrk13876keN@bay2-44.quincy.ziplink.net>
brian d foy <comdog@computerdog.com> wrote:
> >I don't think it can be done using just a s///. (Yes, /e would help,
> >but the prints would be in the wrong place. :-)
>
> does this count? :)
>
> [code that proves me wrong]
It's ugly (no offense), but, yes, I'd have to say it counts. Well done!
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Wed, 8 Jul 1998 23:01:23 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Perl CGI and warnings [Was: Re: -w on production code (was Re: better way of getting the last modified file?)
Message-Id: <jaf1o6.do8.ln@localhost>
Josh Kortbein (kortbein@iastate.edu) wrote:
: /home/kortbein% ls -l /var/local/httpd-cgi/*.* | wc
: 183 1648 16130
Hmmm. I'm confused about the above.
'ls' is a Unix command.
*.* is how PoB types match all files.
Are you using a Unix system or Microsoft system?
(If Unix, then the above will list _only_ those files that happen to
have a dot in their filename.
Of course, maybe you intended to exclude the dotless files?
)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 9 Jul 1998 04:53:41 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Perl CGI and warnings [Was: Re: -w on production code (was Re: better way of getting the last modified file?)
Message-Id: <6o1icl$8tq$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Tad McClellan
<tadmc@flash.net>],
who wrote in article <jaf1o6.do8.ln@localhost>:
> Josh Kortbein (kortbein@iastate.edu) wrote:
>
>
> : /home/kortbein% ls -l /var/local/httpd-cgi/*.* | wc
> : 183 1648 16130
>
>
> Hmmm. I'm confused about the above.
>
>
> 'ls' is a Unix command.
Hmm, what makes you think so?
F:\ckermit\get\perl>ls -l c:\dos | wc
121 722 5100
Ilya
------------------------------
Date: Thu, 09 Jul 1998 04:09:50 GMT
From: "Michael D. Schleif" <mike.schleif@aquila.com>
Subject: setuid root & failed system call
Message-Id: <35A441CF.7E5C427B@aquila.com>
If this is documented, God, show me the light!
A couple weeks ago, I needed to integrate a sub to ping subject UNIX and
wintel hosts prior to running a proprietary system call against same.
Since I cannot get Net::Ping to work with proto 'tcp' nor 'udp' on any
wintel boxes, I need to use proto 'icmp,' which requires either to be
run by root or setuid root. Of course, that brought me up against Taint
-- and, until I conquered that learning curve, that is where I thought
my problem lay . . .
Taint conquered. Net::Ping(icmp) works as expected.
Now, when I run this program it fails at the proprietary system call:
"ld.so.1: wls: fatal: libas.co: open failed: No such file or directory"
Interestingly:
(1) Run without setuid root, the program fails for taint errors;
(2) Remove setuid root and Net::Ping sub, the program works as expected,
including proprietary system call;
(3) Keep setuid root and Net::Ping, including proprietary system call,
su to root, and the program works as expected;
(4) Re-write program as shell script, including proprietary system call,
setuid root and script works as expected.
Clearly, there is some interaction between Perl, setuid root and this
proprietary system call.
What am I missing here? Any ideas?
--
Best Regards,
mds
mds resource
888.250.3987
"Dare to fix things before they break . . . "
"Our capacity for understanding is inversely proportional to how much we
think we know. The more I know, the more I know I don't know . . . "
------------------------------
Date: Wed, 8 Jul 1998 23:05:31 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Splitting a difficult CSV file
Message-Id: <bif1o6.do8.ln@localhost>
Matthew Giles (mgiles@mindspring.com) wrote:
: I am totally stumped on how to split this Excel exported CSV file that is
: being delivered to me each day.
: Any ideas on how to approach it?
the Text::CSV module?
: I'm sure someone else has tackled this
: type of a data file problem before..
the Text::CSV module ;-)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 9 Jul 1998 04:06:42 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: tough regexp - help needed
Message-Id: <6o1fki$6lf$4@client3.news.psi.net>
otis@my-dejanews.com (otis@my-dejanews.com) wrote on MDCCLXXII September
MCMXCIII in <URL: news:6o0sc2$fjd$1@nnrp1.dejanews.com>:
++
++
++ sounds like nobody knows the right regexp :(
Have you stopped beating your wife yet?
Abigail
--
perl -e '$a = q 94a75737420616e6f74686572205065726c204861636b65720a9 and
${qq$\x5F$} = q 97265646f9 and s g..g;
qq e\x63\x68\x72\x20\x30\x78$&eggee;
{eval if $a =~ s e..eqq qprint chr 0x$& and \x71\x20\x71\x71qeexcess}'
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 3103
**************************************