Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: How to get the name from a reference

by repellent (Priest)
on Mar 30, 2009 at 17:12 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://754190]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (3)
As of 2024-04-18 18:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found