[Chicago-talk] @ARGV while(<>)

Randal L. Schwartz merlyn at stonehenge.com
Fri Jan 4 14:12:56 PST 2008


>>>>> "Richard" == Richard Reina <richard at rushlogistics.com> writes:

Richard> #!/usr/bin/perl5 -w 

Richard> @ARGV = $infile;

Since you haven't defined $infile here (aside: use strict would have caught
this... why aren't you using it?), you're assigning @ARGV as a single undef.

Richard> my $body = "";

Richard> while(<>) {

Now, @ARGV contains only a single undef, which I *think* will be interpreted
as the empty string, which might open up the current directory (at
least, in old unix versions it would have) and read that.  Probably
not what you want.

Richard>     unless(/epsf\[/) {
Richard>             $body = $body . $_;
Richard> }

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn at stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


More information about the Chicago-talk mailing list