in reply to How do I query the package name of an object?
Simply
use strict; my $foo = sample->new; print $foo;
prints out the package name as well as some information uniquely identifying the object you have. If you really only want the package name, the ref function is what you need:
use strict; my $foo = sample->new; print ref $foo;
|
|---|