use strict;
use warnings;
sub asub { my $c = 0; print ++$c,": $_ - heee\n" for @_ }
+
my $x = 'asub';
main->$x($x, 'blorf');
__END__
1: main - heee
2: asub - heee
3: blorf - heee
As you can see, the package - main - is passed into the sub as the first argument.
Note that the package passed is just a string, not a refenrence. It would be a reference, if the invocant was a blessed variable:
use strict;
use warnings;
sub asub { my $c = 0; print ++$c,": $_ - heee\n" for @_ }
+
my $x = 'asub';
my $obj = bless \$x;
$obj->$x($x, 'blorf');
__END__
1: main=SCALAR(0x1492870) - heee
2: asub - heee
3: blorf - heee
perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'
|