I hate 'HASH' eq ref(...) since it doesn't consider blessed hashes to be hashes, and there are sometimes valid reasons for treating blessed hashes as hashes that don't even violate object encapsulation (for example, from inside the object's own methods).
I'd prefer:
my $ref= $self->{x}; return %{$ref} if UNIVERSAL::isa($ref,'HASH');
See also Want.pm.
- tye (but my friends call me "Tye")In reply to (tye)Re: A vexing list vs. scalar context question.
by tye
in thread A vexing list vs. scalar context question.
by theguvnor
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |