awohld has asked for the wisdom of the Perl Monks concerning the following question:
Here's my output:#!/usr/bin/perl -w use strict; use List::Compare; my @one = qw( 384 425 ); my @two = qw( 384 425 466 507 548); my @three = qw( 466 507 ); my @four = qw( 666 999 ); my $lc = List::Compare->new( \@one, \@two ); my @intersection = $lc->get_intersection; print "Out 1: @intersection\n"; $lc->new( \@three, \@two ); @intersection = $lc->get_intersection; print "Out 2: @intersection\n"; $lc->new( \@four, \@two ); @intersection = $lc->get_intersection; print "Out 3: @intersection\n";
It should look like this:Out 1: 384 425 Out 2: 384 425 Out 3: 384 425
Is this a bug? I didn't see it in the documentation for List::Compare, but do I have to flush the lists out of the List::Compare object first? Or do I have to create a new object for each new comparision.Out 1: 384 425 Out 2: 466 507 Out 3:
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Bug in List::Compare or User Error?
by McDarren (Abbot) on Feb 15, 2006 at 06:44 UTC | |
by awohld (Hermit) on Feb 15, 2006 at 06:59 UTC |