Steffen Beyer <[EMAIL PROTECTED]> writes:
>
>There's nothing fundamentally evil about setting the refcount to a lower
>value, because this just triggers the DESTROY() event sooner than it would
>normally. Since after receiving this event the correct refcount is restored,

You cannot always acually _do_ that - you can try but it does not work 
in some cases:

            if (SvREFCNT(sv)) {
                if (PL_in_clean_objs)
                    Perl_croak(aTHX_ "DESTROY created new reference to dead object 
'%s'",
                          HvNAME(stash));

So in order to play such games you must be 100% sure there are, and will
not be, any "extra" REFCNTs that will delay your "event" to final cleanup stage.
Extra REFCNTs are all too easy to create ... been there.

>Perl is never even aware of the altered refcount and thus cannot produce
>any malfunction whatsoever.



>
>And I wasn't exactly recommending this, I just informed about the possibility
>to do so, and that it works well.
>
>It's still and always the choice and responsibility of each module author
>what he chooses to do or not to do.
>
>Regards,
-- 
Nick Ing-Simmons

Reply via email to