Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: How to get the name from a reference

by repellent (Priest)
on Mar 30, 2009 at 17:12 UTC ( #754190=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    # obtain CODEref name
    use B;
    ...
        my $obj = B::svref_2object($coderef);
        return $obj->GV->STASH->NAME . "::" . $obj->GV->NAME;
    }
    
  2. or download this
    > perl -MDevel::Peek -e '$var = 123; Dump \$var; sub my_sub {}; Dump \
    +&my_sub'
    SV = RV(0x8073260) at 0x804cc28
    ...
        PADLIST = 0x8064b04
        PADNAME = 0x804cce8(0x8088758) PAD = 0x8065678(0x805e5b0)
        OUTSIDE = 0x804cd78 (MAIN)
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (11)
As of 2014-09-01 11:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (6 votes), past polls