Keep It Simple, Stupid | |
PerlMonks |
Re^2: What does !$saw{$_}++ meansby Anonymous Monk |
on Jan 26, 2005 at 09:56 UTC ( [id://425157]=note: print w/replies, xml ) | Need Help?? |
With no change to the idiom, I'd write that as,But that extends the lifetime of %saw. If later in the same (or an inner) block, you need to use the same construct, you have to use a different name for the hash, or do a %saw = () - which will then cause errors if you remove the first construct (until you my the newer construct). I like to write it as: which doesn't leak the name of the temporary array.
In Section
Seekers of Perl Wisdom
|
|