my @blah = qw/foo bar baz/; # where you would have accessed "blah" . $i, you can # now access $blah[$i] instead for my $i (0..$#blah) { print $blah[$i], "\n"; } # or you can just foreach foreach my $thing (@blah) { print $thing, "\n"; }