in reply to Re: cpan install($_) doesn't work in loop, but normal lexical var does
in thread cpan install($_) doesn't work in loop, but normal lexical var does
The magic of $_ is too fragile for anything but simple cases in my opinion.Yes, but it's the authors of CPAN modules that should be watching out for this, not the users of the modules.
Something I've wondered about off-and-on: is there any compelling reason not to do a "local $_;" at the beginning of every subroutine, unless you're relying on a value being passed in via $_? Why isn't this one of our "best practices"?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: cpan install($_) doesn't work in loop, but normal lexical var does
by starbolin (Hermit) on Aug 28, 2006 at 00:23 UTC | |
by doom (Deacon) on Aug 28, 2006 at 02:29 UTC | |
by starbolin (Hermit) on Aug 29, 2006 at 00:47 UTC | |
by shmem (Chancellor) on Aug 29, 2006 at 06:45 UTC |