Skip Menu |

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

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

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

Bug Information
Severity: (no value)
Broken in:
  • 1.22
  • 1.23
Fixed in: (no value)



Subject: isweak (maybe weaken too?) doesn't work on references to arrays/hashes
isweak seems to notice weaken when on SCALAR references but not on HASH or ARRAY references. The enclosed test script fails tests 6 and 8. Tested on 5.12 -Thanks
Subject: weak_ref_to_obj.t
#!/usr/bin/perl -w use Test::More tests => 8; use Scalar::Util qw(weaken isweak); use warnings; use strict; my $a; my $b = \$a; ok(! isweak($b), "b not weak"); weaken($b); ok(isweak($b), "b weak"); my $x = { y => [ 0, 1, 2], z => \$a, w => { a => 7 } }; ok(! isweak($x->{z}), "z not weak"); weaken($x->{z}); ok(isweak($x->{z}), "z weak"); ok(! isweak($x->{y}), "y not weak"); weaken($x->{y}); ok(isweak($x->{y}), "y weak"); ok(! isweak($x->{w}), "w not weak"); weaken($x->{w}); ok(isweak($x->{w}), "w weak");
Subject: perl-V
Download perl-V
application/octet-stream 2.7k

Message body not shown because it is not plain text.

Just realized what I did wrong. Trying again.