in reply to Getting name of sub from a hash-based dispatch table?

Looking for a _ is probably the wrong way to decide this, as others have said. But here is how you get a sub name from a coderef:
sub getsubname { use B 'svref_2object'; my $coderef = shift; join '::', eval { svref_2object($coderef)->GV->STASH->NAME }, eval { svref_2object($coderef)->GV->NAME } }
Returns false if something goes wrong (like not getting a coderef). Name will be pkg::__ANON__ for anonymous subs. And if the coderef is to an exported sub, the original name and package will be given.