for my $index (0 .. $#array) { print "$index: $array[$index]\n"; }