And by the same token, if you're a module author, you have no control over your user's code, and if you're stomping on $_, eventually one of them will be burned by it."...is there any compelling reason not to do a "local $_;" at the beginning of every subroutine?"Yes, doesn't fix the problem. Any time you call a function, subroutine or method it could blow away $_. And you will never have control of other peoples code so if you rely on $_ not being hosed you'll eventually get burnt.
So if you don't want to burn your users, you should always localize $_.
In reply to Re^4: cpan install($_) doesn't work in loop, but normal lexical var does
by doom
in thread cpan install($_) doesn't work in loop, but normal lexical var does
by tphyahoo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |