There's more than one way to do things | |
PerlMonks |
Re^4: How come undef eq '' ??by muba (Priest) |
on Jan 31, 2013 at 01:45 UTC ( [id://1016192]=note: print w/replies, xml ) | Need Help?? |
This code feels... itchy... to me. No offense ;) Let's assume ref($hash) ne 'HASH', then $data = $hash, so ref($data) will never eq 'HASH', so that statement modifier on the last line is redundant in this case. However, say ref($hash) eq 'HASH' is true, then $data = $$hash{$name}, and then $data = $$data{CONTENT} provided that $$hash{$name} is a hashref. For the sake of argument, let's say it isn't. Then $data will still be $$hash{$name}. Is that how it's supposed to work?
In Section
Seekers of Perl Wisdom
|
|