Get array last index
#!/usr/bin/perl -w use strict; my @array = (2, 4, 6, 8); print "the last index is: ", $#array, "\n";