{ local $[ = 1; for my $x (1 .. $X) { for my $y (1 .. $Y) { # Do something with $array[$x][$y] print "bla, bla ($x, $y)"; } } }