use B; sub cv2name { eval { my $obj = B::svref_2object( shift() ); $obj->STASH->NAME . "::" . $obj->GV->NAME; } || undef; }