Trickery.
use B; sub cv2name { # Updated to use scalar eval { ... } to trap errors and still use +the proper context return scalar eval { my $obj = B::svref_2object( shift ); my $package = $obj->STASH->NAME; '&' . ( $package eq 'main' ? '' : "${package}::" ) . $obj->GV- +>NAME; } }
In reply to Re: Good way of getting subroutine name from ref?
by diotalevi
in thread Good way of getting subroutine name from ref?
by bronson
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |