Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re^3: How to de-reference a coderef? (B tricks)

by ikegami (Pope)
on Aug 25, 2011 at 04:29 UTC ( #922272=note: print w/ replies, xml ) Need Help??

in reply to Re^2: How to de-reference a coderef? (B tricks)
in thread How to de-reference a coderef?

use strict; use warnings; use feature qw( say ); use Inline C => <<'__EOI__'; SV* coderef2name(CV* cv) { const GV * const gv = CvGV(cv); const HV * const stash = GvSTASH(gv); const char * const pkg_name = HvNAME(stash); const char * const func_name = GvNAME(gv); SV * const fqn = newSVpvn("", 0); sv_catpv(fqn, pkg_name); sv_catpv(fqn, "::"); sv_catpv(fqn, func_name); return fqn; // Mortalised by Inline } __EOI__ sub f {} say coderef2name(\&f);

Comment on Re^3: How to de-reference a coderef? (B tricks)
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2015-11-26 04:21 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (696 votes), past polls