There is only one $_True.
and the second use of it destroys the contents of the first use.False.
The second use of '$_' doesn't destroy the content of the first use. It stores it somewhere else, and restores the value after the second use is finished. That's the principle of local. And that's what's happening with a foreach loop.foreach ("a", "b") { # First use of $_ foreach ("c", "d") { # Second use of $_ say; } say; # 'Old' value of $_ } __END__ c d a c d b
In reply to Re^2: variable like $_
by JavaFan
in thread variable like $_
by perlthirst
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |