my @foo = qw(one two three four); for (0..$#foo) { print "$_ : $foo[$_] \n"; }