"be consistent" | |
PerlMonks |
Re^2: Why does testing a key create a hash?by friedo (Prior) |
on Aug 17, 2005 at 22:39 UTC ( [id://484625]=note: print w/replies, xml ) | Need Help?? |
Use if exists $hash->{1} instead. Nope, that will still cause $hash to become a hashref and print 1 if $hash; will print 1. exists takes a hash element, and you can't have a hash element without a hash! :)
In Section
Seekers of Perl Wisdom
|
|