Skip Menu |

This queue is for tickets about the Scalar-List-Utils CPAN distribution.

Report information
The Basics
Id: 90227
Status: rejected
Priority: 0/
Queue: Scalar-List-Utils

People
Owner: Nobody in particular
Requestors: POWERMAN [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.35
Fixed in: (no value)



Subject: weaken CODEREF
Looks like weaken doesn't support CODE: $ perl -MScalar::Util=weaken -E '$a={}; weaken($b=$a);$a=0;say $b' $ perl -MScalar::Util=weaken -E '$a=sub{};weaken($b=$a);$a=0;say $b' CODE(0x5964f33f920) Tested on perl-5.12.4, Scalar::Util-1.35. On perlmonks this issue was confirmed on 5.18.0: http://perlmonks.org/?node_id=1061941
On Sun Nov 10 23:33:49 2013, POWERMAN wrote: Show quoted text
> Looks like weaken doesn't support CODE: > > $ perl -MScalar::Util=weaken -E '$a={}; weaken($b=$a);$a=0;say $b' > > $ perl -MScalar::Util=weaken -E '$a=sub{};weaken($b=$a);$a=0;say $b' > CODE(0x5964f33f920) > > Tested on perl-5.12.4, Scalar::Util-1.35. > On perlmonks this issue was confirmed on 5.18.0: > http://perlmonks.org/?node_id=1061941
The reference is weakened in this case, but the subroutine has a reference elsewhere, namely, in the op tree. Try this: $ perl -MScalar::Util=weaken -E '$a=eval"sub{}";weaken($b=$a);$a=0;say $b' This is related to perl bugs #3305 and #3306. In short, there is no bug in Scalar::Util here.
Thanks for explanation.