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)