Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^5: References for ano subs fixed at compile time? (opnode)

by tye (Sage)
on Jun 18, 2013 at 22:59 UTC ( [id://1039687]=note: print w/replies, xml ) Need Help??


in reply to Re^4: References for ano subs fixed at compile time? (nope)
in thread References for ano subs fixed at compile time?

Well, that part is the stupider part. If address X is no longer used, it is obvious that address X might be re-used. If address X gets re-used, it is obvious that it might still be being used and so can't be re-used a third time.

But, indeed, even completely identical code refs get recreated each time in my version of Perl (so I lose my bet). Which probably means that a closure is generated even if nothing got closed over.

But each closure contains a pointer to the code that got compiled for that (trivial) sub. Perhaps that is what you want?

- tye        

  • Comment on Re^5: References for ano subs fixed at compile time? (opnode)

Replies are listed 'Best First'.
Re^6: References for ano subs fixed at compile time? (opnode)
by LanX (Saint) on Jun 19, 2013 at 00:30 UTC
    > Perhaps that is what you want?

    I thought I could use the code-ref as reliable identifier for the call position ( not just the line-number caller provides ).

    Something which can be used to emulate position dependent built-ins like the flip-flop operator.

    I tried B::svref_2object but the docs to B are somehow cryptic...

    Cheers Rolf

    ( addicted to the Perl Programming Language)

Log In?
Username:
Password:

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

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

    No recent polls found