in reply to Re: 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 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."
  • Comment on Re: Re: Re: Why Perl does not support database access through core modules?

Replies are listed 'Best First'.
Re: Re: Re: Re: Why Perl does not support database access through core modules?
by ambrus (Abbot) on Jan 22, 2004 at 10:52 UTC

    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."