Dec 212010
How can I find out my current package in Perl?
Answer:
To find the current package in your Perl script, you can try something like the following:
package Foo;
my $current_package = __PACKAGE__;
print "I am in package $current_package\n";
1;
When executed:
# perl foo.pl
I am in package Foo