in reply to Re: Is there a way to find out what kind of ref an object is?
in thread Is there a way to find out what kind of ref an object is?
Actually, ref doesn't give the underlying implementation. In the example code you gave, it should give 'BLAH', which doesn't tell you if 'BLAH' is an arrayref, or a hashref:
for my $i ( [], {} ) { bless $i, 'BLAH'; printf( "%s\t%s\n", ref($i), $i ) }
I typically use tye's answer, and go with UNIVERSAL::isa. (eg, if I'm dealing with structures passed in from a SOAP call, and I want to make sure the structure is right, even if the class name is wrong, before I start to manipulate it)
|
|---|