Chas. Owens wrote:
On Thu, Feb 19, 2009 at 10:20, mritorto <mrito...@gmail.com> wrote:
owen,

How do you use the List::Compare module is the same as array::compare?
snip

List::Compare can be found in CPAN*.  Here is you program rewritten to
use it (this is not what I would do):

We know. ;-)

<snip>

my @atlas = <$atlas>;
my @isis  = <$isis>;

my $comparison = List::Compare->new(\...@atlas, \...@isis);

print $comparison->get_symmetric_difference;

It's worth noting that if the so called symmetric difference is sufficient, the same result is achieved if you use the approach suggested in

    perldoc -q difference.+arrays

Actually, you only need one single hash:

    my %count;
    $count{$_}++ while <$atlas>;
    $count{$_}++ while <$isis>;
    print sort map { $count{$_} == 1 ? $_ : () } keys %count;

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to