use v5.12; use strict; use warnings; my @SampleArray = ("one", "two", "three"); while (my ($ArrayIndex, $ArrayItem) = each @SampleArray) { printf( "%s is at location %d in the array\n", $ArrayItem, $ArrayIndex, ); }