# change the starting index -- usually not a good idea. $[ = 2; # create a sample array @data = qw(one two three four); # try to find the last index value $bad = @data - 1; $still_bad = scalar @data - 1; $good = $#data; # what did we find? print "bad: $bad\n"; # gives 3 print "still bad: $still_bad\n"; # gives 3 print "good: $good\n" # gives 5