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 #### 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