<?xml version="1.0" encoding="windows-1252"?>
<node id="997051" title="Re: compare arrays, and list the difference" created="2012-10-03 09:12:27" updated="2012-10-03 09:12:27">
<type id="11">
note</type>
<author id="922586">
Lotus1</author>
<data>
<field name="doctext">
&lt;p&gt;[http://search.cpan.org/~jkeenan/List-Compare-0.37/lib/List/Compare.pm|List::Compare] does exactly what you need and it is easy to use.&lt;/p&gt;

&lt;c&gt;
    @Llist = qw(abel abel baker camera delta edward fargo golfer);
    @Rlist = qw(baker camera delta delta edward fargo golfer hilton);

    $lc = List::Compare-&gt;new(\@Llist, \@Rlist);


get_unique() 
Get those items which appear (at least once) only in the first list.

    @Lonly = $lc-&gt;get_unique;
    @Lonly = $lc-&gt;get_Lonly;    # alias
get_complement() 
Get those items which appear (at least once) only in the second list.

    @Ronly = $lc-&gt;get_complement;
    @Ronly = $lc-&gt;get_Ronly;            # alias
&lt;/c&gt;</field>
<field name="root_node">
997024</field>
<field name="parent_node">
997024</field>
</data>
</node>
