my $i = 0 ; for ( @ARGV ) { $i++ ; print "i:$i for argv $_\n" ; } print "$i is the final index of argv\n" ;