in reply to Using $_ in nested loops

A for (@ary) {} is like for local $_ (@ary) {}. So when using for(?:each)? loops it is safe to nest as much as you like......but

for loops are almost the only thing which automatically localises $_. While loops do not. New scopes do not. New packages/files do not. maps and greps do. foreach does. Three argument for does not. And theres probably more things I should be listing.

for (@files) { open FILE, $_; while (<FILE>) { push @res, grep {ord($_)<128} split //, $_; } close FILE; }
Be careful, know what's happening and don't overuse $_ where using sensible variable names would be more sensible.