Think about Loose Coupling | |
PerlMonks |
uninitialized $_ sneaks past warnings in grep/map block or expressionby rir (Vicar) |
on Sep 01, 2010 at 13:36 UTC ( [id://858335]=perlquestion: print w/replies, xml ) | Need Help?? |
rir has asked for the wisdom of the Perl Monks concerning the following question:
Update: I'd downvote this if I could. My error was thinking $a and $b when
$_ was appropriate.
The recent thread, Better algorithm or data structure?, shows that this behavior of $_ is not well known. It surprised me. It took prompting for this aspect to register (thanks, BrowserUk). Update: reduced code to the point. This expresses that to which I was referring. Map and grep, like for can, localize $_; this makes this post nonsensical; Be well, rir Original verbose code: <Reveal this spoiler or all in this thread>
Back to
Seekers of Perl Wisdom
|
|