Hi!

In a book called "Open Source Linux Web Porgramming" by Jones and Batchelor, 
it says (on Page 61):

"When you launch a script from the command line, for example, @_ populates 
with all of the parameters passed in through the command line.  The shift 
function, among others, will use @_ by default if no other array is provided.

#!/usr/bin/perl
@firstCommandLineArg=shift;
@secondCommandLineArg=shift;"

The provided code snipplet works but if I use "shift @_" (since @_ is 
supposedly used by default anyway), I do not get the command line 
arguments.

However, if I use "shift @ARGV", I DO get the command line arguments.  If the 
shift function really does use @_ as its default argument, then why did shift 
in the example code, use @ARGV as default?  Does @_ really get populated 
"with all of the parameters passed in through the command line"?

Thanks,
George Petri

Reply via email to