in reply to [untitled node, ID 193989]

Not reliably. Here's code that breaks dws' example. I've never had the need for the feature you describe, however. (I could also walk the symbol tables until I found the right CV, but that's even worse. :)

my $sub; BEGIN { $sub = sub { my ($called) = (caller(0))[3]; warn "Called as <$called>\n"; }; *{ bar } = $sub; } my $b = \&bar; $sub->(); *{ foo } = $sub; foo(); bar(); $b->(); *{ baz } = $b; baz();