- or download this
sub test {
my($pkg) = caller;
...
__END__
I've been called from package Foo
- or download this
$Foo::x # scalar
@Foo::y # array
%Foo::z # hash
$Foo:z{bar} # hash item
# etc.
- or download this
my $pkg = "Foo";
my $var = "x";
...
__END__
prints: "123";