Skip Menu |

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

Report information
The Basics
Id: 46589
Status: resolved
Priority: 0/
Queue: Set-Scalar

People
Owner: Nobody in particular
Requestors: #!^!#&!pan.org'
$_
'spro^^*%*^6ut# [...] &$%*c
=
print
y/a-z. [...] //cd
Cc:
AdminCc:

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



Subject: intersection+refs
I have found a bug in Set::Scalar 1.23. The intersection method does not like references in the set. The attached patch fixes it. I hope you find this helpful.
Subject: open_g7iivwvc.txt
Binary files Set-Scalar-1.23-ZFAhUj/.DS_Store and Set-Scalar-1.23-ZFAhUj copy/.DS_Store differ diff -Nurp Set-Scalar-1.23-ZFAhUj/lib/Set/Scalar/Base.pm Set-Scalar-1.23-ZFAhUj copy/lib/Set/Scalar/Base.pm --- Set-Scalar-1.23-ZFAhUj/lib/Set/Scalar/Base.pm 2009-01-16 18:44:51.000000000 -0800 +++ Set-Scalar-1.23-ZFAhUj copy/lib/Set/Scalar/Base.pm 2009-05-14 21:24:00.000000000 -0700 @@ -306,7 +306,7 @@ sub _intersection ($$) { my %intersection = _make_elements $intersection->elements; - delete @intersection{ $that->elements }; + delete @intersection{ keys %{{ _make_elements $that->elements }} }; $intersection->delete( values %intersection ); diff -Nurp Set-Scalar-1.23-ZFAhUj/t/intersection.t Set-Scalar-1.23-ZFAhUj copy/t/intersection.t --- Set-Scalar-1.23-ZFAhUj/t/intersection.t 2005-08-06 02:34:46.000000000 -0700 +++ Set-Scalar-1.23-ZFAhUj copy/t/intersection.t 2009-05-14 21:24:37.000000000 -0700 @@ -1,6 +1,6 @@ use Set::Scalar; -print "1..23\n"; +print "1..24\n"; my $a = Set::Scalar->new("a".."e"); my $b = Set::Scalar->new("c".."g"); @@ -95,6 +95,12 @@ print "ok 20\n"; print "ok 23\n"; } +print "not " unless join("", sort @{ + new Set::Scalar \$1,\$2,\$3,->intersection( + new Set::Scalar \$2,\$3,\$4 + ) +}) eq join "", sort \$2,\$3; +print "ok 24\n";
Subject: Re: [rt.cpan.org #46589] intersection+refs
Date: Tue, 02 Jun 2009 20:38:28 -0400
To: bug-Set-Scalar [...] rt.cpan.org
From: Jarkko Hietaniemi <jhi [...] iki.fi>
Father Chrysostomos via RT wrote: Show quoted text
> Mon Jun 01 11:45:03 2009: Request 46589 was acted upon. > Transaction: Ticket created by SPROUT > Queue: Set-Scalar > Subject: intersection+refs > Broken in: 1.23 > Severity: Important > Owner: Nobody > Requestors: #!^!#&!pan.org', $_, 'spro^^*%*^6ut#@&$%*c, =, print, y/a-z.@//cd > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=46589 > > > > I have found a bug in Set::Scalar 1.23. The intersection method does not like references in the > set. The attached patch fixes it. I hope you find this helpful. >
Thanks for the fix! Set::Scalar 1.24 released.