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;
In reply to Re: How do I query the package name of an object?
by Corion
in thread How do I query the package name of an object?
by nmerriweather
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |