Perl Monk, Perl Meditation | |
PerlMonks |
Re^2: if (defined %hash) deprecatedby Ralesk (Pilgrim) |
on Oct 16, 2012 at 08:12 UTC ( [id://999253]=note: print w/replies, xml ) | Need Help?? |
By assigning to a scalar or by checking truthiness, you’re forcing a scalar context, so it can be expected to behave the same – that is, return a falsy value (0) when empty and non-falsy when not (and all the bucket counts are non-falsy). Same goes for arrays which report number of elements when not wantarray.
In Section
Seekers of Perl Wisdom
|
|