Get array element by index
#!/usr/bin/perl use strict; use warnings; my @array = ("First", "Second"); foreach (0..$#array) { print "Element number $_ contains $array[$_] \n"; }