in reply to Re^3: Garbage Collection and undef
in thread Garbage Collection and undef

Can you find documentation of this claim? The Perl documentation that I've read says that Perl uses classic reference counting and does not handle circular garbage (until it has to free everything when it exits). Which is why we have Devel::WeakRef.

For instance see Reference Counts and Mortality in perlguts or Two-Phased Garbage Collection in perlobj. You can verify what that says by experimenting with DESTROY methods. They exhibit reliable behaviour that they wouldn't if true GC were in use. Else my ReleaseAction wouldn't work as advertised.

Replies are listed 'Best First'.
Re^5: Garbage Collection and undef
by ihb (Deacon) on Oct 17, 2004 at 05:54 UTC

    What's the reason for having ReleaseAction when End already exists on CPAN (and was uploaded before)? If there is no profound reason, why not deprecate one of them and incorporate it in the other?

    ihb

    Read argumentation in its context!

      Because I didn't know about End?

      If you want, blame merlyn. I originally wasn't going to release ReleaseAction. But he thought that it was an interesting module, noted how it made the core module SelectSaver trivial to implement, and encouraged me to release on CPAN. I think that if either of us had realized that it already existed, I wouldn't have released.

      You're right that the two are very similar. Mine is more flexible though. I allow you to cancel the action before it happens. I allow you to pass arguments into the closure. (I don't document that very clearly though.) I give you an optional OO interface.

      While I would not have released had I realized that the same module was out there already, at this point I see no harm in having both available. I'll update my module to mention End though.