It does localize $_, but it also aliases it to each item. Quoth perldoc perlsyn:
The "foreach" modifier is an iterator: it executes the statemen +t once for each item in the LIST (with $_ aliased to each item in turn +).
In reply to Re: Understanding typeglobs and local()
by Fletch
in thread Understanding typeglobs and local()
by whio
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |