Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re^4: Referencing a hash of hashes

by imp (Priest)
on Aug 18, 2006 at 15:35 UTC ( #568194=note: print w/replies, xml ) Need Help??

in reply to Re^3: Referencing a hash of hashes
in thread Referencing a hash of hashes

Please note that the code in this post is not the recommended method. It makes uses of B, which is the perl compiler backend. As such it is a little too magical to be used in production code.

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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://568194]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2020-02-21 07:11 GMT
Find Nodes?
    Voting Booth?
    What numbers are you going to focus on primarily in 2020?

    Results (93 votes). Check out past polls.