in reply to ARGV behaviour in getopts std
but why $#ARGV !=6 is true?Because $#ARGV is 5, which you can prove by printing its value:
@ARGVuse warnings; use strict; use Data::Dumper; use Getopt::Std; print '$#ARGV=', $#ARGV, "\n"; print Dumper(\@ARGV); if ($#ARGV == -1 || $#ARGV !=6) { print "ARGV is now reduced to <".@ARGV."> members:\n";#prints ARGV + as 6 } __END__ $#ARGV=5 $VAR1 = [ '-b', 'opt_b', '-p', 'opt_p', '-c', 'opt_c' ]; ARGV is now reduced to <6> members:
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: ARGV behaviour in getopts std
by perl_mystery (Beadle) on Dec 21, 2010 at 23:05 UTC | |
by toolic (Bishop) on Dec 22, 2010 at 01:10 UTC | |
by perl_mystery (Beadle) on Dec 22, 2010 at 02:33 UTC | |
by Argel (Prior) on Dec 22, 2010 at 17:57 UTC | |
|