in reply to Re: Why Perl does not support database access through core modules?
in thread Why Perl does not support database access through core modules?

I think that Scalar::Util should be in core, because of the weak references. It would be strange if the perl binary could handle weakrefs but you would have to download a module to use them. AFAIK, weak refs were experimental with 5.6 versions, but they are not in 5.8, and so 5.8 has Scalar::Util in core, 5.6 does not. Correct me if I'm wrong please.

  • Comment on Re: Re: Why Perl does not support database access through core modules?

Replies are listed 'Best First'.
Re: Re: Re: Why Perl does not support database access through core modules?
by shotgunefx (Parson) on Jan 21, 2004 at 18:03 UTC
    I think that weakrefs were only experimental as far as using them from the Perl side of things. I believe it's been available in the interpreter for all of the 5.x series. I've never looked at the source for Scalar::Util, but I would guess it's just a wrapper around newrv_noinc()

    -Lee

    "To be civilized is to deny one's nature."

      I think no. Scalar::Util::weaken creates a weak reference that will be undefed if what it points to is freed. newrv_noinc won't do that I belive.

        I think your right, it looks like it sets a flag on the sv. I've only done a little bit of work with XS, but I thought that if the rv was no longer valid, you would pick up on that with SvROK. Maybe there was concern about weakening the same reference multiple times? update
        To who every downvoted this, you're a d1ck.


        -Lee

        "To be civilized is to deny one's nature."