in reply to Asking An Object For It's Class
This may not return what you expect though, because most objects are of more than 1 type (they are whatever they were last bless()'ed as, and all of their parent class types). Someone else can certainly better explain exactly what ref() will return in various circumstances.my $what_is_it = ref($unidentified_object);
Depending on what you're trying to do, one or the other should probably do what you need.if ( $u_o->isa("blah" ) ) { # do something } elsif ( $u_o->isa("something_else") ) { # do something else } ...
|
|---|