use strict; use warnings; my @SampleArray = ("one", "two", "three"); for my $ArrayIndex ( 0 .. $#SampleArray ) { printf( "%s is at location %d in the array\n", $SampleArray[$ArrayIndex], $ArrayIndex, ); }