use strict;
# @ARGV is an array, so number of args in an array is $#ARGV+1
# The last element position is $#ARGV.
# Also I like to line up brackets and braces.
my $numargs = $#ARGV+1;
print "numargs = $numargs\n";
if ( $numargs > 0 )
{ for my $a ( @ARGV ) # $a gets assigned to each item in @ARGV.
{ print " $a\n"; }
}
In reply to Re: Why doesn't @ARGV work?
by bulrush
in thread Why doesn't @ARGV work?
by LloydRice
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |