in reply to Re: ARGV behaviour in getopts std
in thread ARGV behaviour in getopts std

What is the difference between $#ARGV and @ARGV?I can see @ARGV has members,but what is $#ARGV,what does it contain?why is the number five?is it always "1" less than @ARGV?

Replies are listed 'Best First'.
Re^3: ARGV behaviour in getopts std
by toolic (Bishop) on Dec 22, 2010 at 01:10 UTC
    You will find the answer if you follow the link that I provided in my original reply and read it. If there is something unclear in the documentation, please specify what you don't understand. Here it is again: @ARGV

      Cool thanks,couldnt see the link before

Re^3: ARGV behaviour in getopts std
by Argel (Prior) on Dec 22, 2010 at 17:57 UTC
    'scalar @array' is the number of elements in @array (sometimes also referred to as the length of @array).

    $#array is the last index of @array. By default the first index in an array is 0, so when using the default settings $#array will be 'scalar @array - 1'.

    Elda Taluta; Sarks Sark; Ark Arks

A reply falls below the community's threshold of quality. You may see it by logging in.