$_ = "abcdefg"; my @some_array = (1 ..2); while (m/./g) { for (@some_array) { # implicitly localized - works # do something; } print $&; }