for my $i (0 .. $#list){ print "index = $i"; print "value = $list[$i]"; }