Subject: | List::Compare mangles non-string lists |
If you pass a couple of lists of objects, List::Compare returns back the stringified version of those objects on any intersection call. This is because the engines rely on returning back the stringified keys of these objects, instead of returning the objects themselves.
For example:
my @full_list = (
BlessedObject->new(1),
BlessedObject->new(2),
BlessedObject->new(3),
BlessedObject->new(4),
);
my @partial_list = (
$full_list[1], $full_list[3]
);
my $lc = List::Compare->new( {
lists => [ \@full_list, \@partial_list ],
accelerated => 1,
unsorted => 1,
} );
# $lc has good objects currently, mainly because of 'accelerated'
my @other_half = $lc->get_Lonly;
# @other_half is nothing but stringified things
Sure, @other_half could then be parsed to compare against the stringified forms of @full_list, but that seems like it would defeat the purpose of using a module to do this.