sub routine { my($thingy, $tx) = @_; # $thingy is not used print "routine: $tx\n"; } my $ref = \&routine; # take a reference to the sub my $pkg = "main"; my $obj = bless do { \my $x }; # we could also say... # my $pkg = __PACKAGE__; # ...to get any package we are in in compile time