[Za-pm] Re: perldoc

Sean Carte scarte at pan.uzulu.ac.za
Fri Jun 6 03:55:21 CDT 2003


On Fri, 2003-06-06 at 10:15, Nick Cleaton wrote:
> exec 'perldoc', $0 if "@ARGV" eq '--help';

Aha! I'm using $ARGV[0] where you're using @ARGV:

> exec 'perldoc', $0 if $ARGV[0] eq '--help';

Your version uses the @ARGV array in a scalar context. Does this mean
that @ARGV evaluates to $ARGV[0] before the comparison? If so, why is it
different when specifying $ARGV[0]?

There's something that I'm not understanding here. What's going on? (Has
everybody else dozed off?)

(In case it becomes relevant:

$ perl -v

This is perl, v5.8.0 built for i386-linux-thread-multi

Using your script with "$ARGV[0]" substituted for "@ARGV":
$ perl test_script.pl
Use of uninitialized value in string at test_script.pl line 14.
hello, world (5.008)
)
-- 
Regards
Sean Carte

University of Zululand
Network Services Unit
Phone: 035 902 6081
Fax: 035 902 6028

"Ooooh fishy fishy fishy fish!"




More information about the Za-pm mailing list