http://www.perlmonks.org?node_id=283710


in reply to Asking An Object For It's Class

From perldoc -f ref
If the referenced object has been blessed into a package, then that package name is returned instead. You can think of "ref" as a "typeof" operator.
So it's
my $class = ref( $unidentified_object );