Subject: | $aset->insert(@$bset) fails |
After a system upgrade I started getting errors in a script which I tracked down to a change in behavior of Set::Object. The attached test script produces different results depending on version:
good: perl 5.024001, Set::Object 1.35 => 3
bad: perl 5.028001, Set::Object 1.39 => 0
Somehow on the new system, objects do not copy to a new set. Replacing the insert line with either of the "OK" commented lines makes the script work as expected.
Subject: | test.pl |
use Set::Object qw/ set /;
my $a = set("a", "b", "c");
my $b = set();
$b->insert(@$a);
# $b->insert(map "$_", @$a); # OK
# $b->insert($a->members); # OK
print "perl $], Set::Object $Set::Object::VERSION => ", $b->size, "\n";
## Formatted for test suite:
#
# my $a = set("a", "b", "c");
# my $b = set();
# $added = $b->insert(@$a);
# is($added, 3, "Set::Object->insert() [ returned # added ]");
# is($b->size(), 3, "Set::Object->size() [ three members ]");