use strict; use warnings; my @x = qw( p e r l ); for my $index (0..$#x){ print "$index : $x[$index]\n"; }