my $x; my @a = qw(one two three); print "$a[$_-1], " while $x++ < $#a; print "$a[$#a]";