I am looking for a nice way to determine the underlying type of an Object (ie SCALAR ARRAY HASH etc) - sort of like a ref($obj) for objects:
For examble
my $obj = Some::Class->new(); my $type = ref_like_function_for_object($obj); if ( $type eq 'HASH' ) ...
I know I can say
but I wonder if there is a better way?$type = 'HASH' if $obj->isa('HASH'); $type = 'ARRAY' if $obj->isa('ARRAY');
In reply to How do I determine the underlying type of an Object? by jaa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |