# Code sample 2 -- Come to think of it, I want the indices too ... for (my $i = 0; $i < @array; $i++) { my $item = $array[$i]; printf "%3d. $item\n", $i + 1; }