Reverse lookup the name of a code-ref
Found on perlmonks here: http://www.perlmonks.org/?node_id=413799
The code:
use B;
sub coderef2name {
eval {
my $obj = B::svref_2object( shift() );
$obj->GV->STASH->NAME . "::" . $obj->GV->NAME;
} || undef;
}
