Ah. Thanks. Try changing both to use

        Scalar::Util::weaken( my $test = [] ); 

Tim.

On Mon, Sep 04, 2006 at 02:29:53AM +0100, Clive George wrote:
> t/72childhandles works fine - the warn $HAS_WEAKEN says "1 at 
> t/72childhandles.t line 19.".
> 
> The zvpp ones give
> 
> Use of uninitialized value in warn at 
> /home/cg5/DBI-1.52/blib/lib/DBI/PurePerl.pm line 49.
> Modification of a read-only value attempted at 
> /home/cg5/DBI-1.52/blib/lib/DBI/PurePerl.pm line 45.
>        ...caught at /home/cg5/DBI-1.52/blib/lib/DBI/PurePerl.pm line 49.
> 
> when I added the warn $HAS_WEAKEN to line 49. (line 45 is 
> Scalar::Util::weaken(my $test = \"foo"); ).
> 
> Ah - t/72childhandles.t doesn't actually have the same code as PurePerl.pm
> 
> my $HAS_WEAKEN = eval {
>    require Scalar::Util;
>    # this will croak() if this Scalar::Util doesn't have a working 
> weaken().
>    Scalar::Util::weaken( \my $test ); # same test as in DBI.pm
>    1;
> };
> 
> vs
> 
> # check for weaken support, used by ChildHandles
> my $HAS_WEAKEN = eval {
>    require Scalar::Util;
>    # this will croak() if this Scalar::Util doesn't have a working 
> weaken().
>    Scalar::Util::weaken(my $test = \"foo");
>    1;
> };
> 
> So which one is correct?
> 
> (We've got Scalar::Util 1.13 - looking at the change log for this hints 
> that weaken hasn't changed in the later versions - should I try 1.18 
> anyway?)
> 
> cheers,
> clive
> 
> ----- Original Message ----- 
> From: "Tim Bunce" <[EMAIL PROTECTED]>
> To: "Clive George" <[EMAIL PROTECTED]>
> Cc: <dbi-users@perl.org>
> Sent: Sunday, September 03, 2006 11:16 PM
> Subject: Re: Make test of 1.52 failed on childhandles
> 
> 
> >Did t/72childhandles also fail, or was it
> >only t/zvpp_72childhandles?
> >
> >Both t/72childhandles.t and lib/DBI/PurePerl.pm use the same code to
> >decide if there's a working Scalar::Util::weaken() available:
> >
> >my $HAS_WEAKEN = eval {
> >    require Scalar::Util;
> >    # this will croak() if this Scalar::Util doesn't have a working 
> >weaken().
> >    Scalar::Util::weaken(my $test = \"foo");
> >    1;
> >};
> >
> >Could you look into this further for me? Adding a
> >warn $HAS_WEAKEN;
> >after that code in both t/72childhandles.t and lib/DBI/PurePerl.pm
> >would be a good place to start.
> >
> >Thanks!
> >
> >Tim.
> >
> >On Fri, Sep 01, 2006 at 04:30:06PM +0100, Clive George wrote:
> >>Hi -
> >>
> >>I just got DBI 1.52 out, and the make test stage failed on childhandles.
> >>This is on AIX 5.3, perl 5.8.2 built for aix-thread-multi.
> >>
> >>t/zvpp_72childhandles....1..14
> >>ok 1
> >>ok 2
> >>not ok 3
> >>not ok 4
> >>ok 5 - All handles should be undef now
> >>ok 6 - ChildHandles should be an array-ref if wekref is available
> >>not ok 7
> >>drh  DBI::dr=HASH(0x3018cb8c)
> >>not ok 8
> >>ok 9
> >>not ok 10
> >>not ok 11
> >>ok 12 - handles should be gone now
> >>ok 13
> >>ok 14
> >>
> >>Is this supposed to happen?
> >>
> >>cheers,
> >>clive
> >>
> >--
> >This email has been verified as Virus free
> >Virus Protection and more available at http://www.plus.net 
> 

Reply via email to