in reply to Re^3: Referencing a hash of hashes
in thread Referencing a hash of hashes
That said, it is interesting to know how to do this, and can be useful at times. This is one way to get the name of a subroutine.
sub a { print "foo\n"; } use B; # Fetch the internal object for this coderef my $obj = B::svref_2object(\&a); # Fetch the glob for that object my $gv = B::CV::GV($obj); print $gv->NAME;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Referencing a hash of hashes
by chromatic (Archbishop) on Aug 19, 2006 at 01:12 UTC |