package foo; sub bar { warn "$self(@_)" } sub tell { $ref = \&bar; warn "$ref" } package main; $ref = foo->can('bar'); warn "$ref"; &$ref('foo'); foo->tell(); #### CODE(0x914dfb8) at tst.pl line 9. (foo) at tst.pl line 3. CODE(0x914dfb8) at tst.pl line 4.