in reply to list comparisons

I am not sure what type of comparison you are doing, but if you only want to see which data is unique to which list you can use this snippet I originally learned in the Cookbook.

#...code filling the arrays #@A = DB list #@B = array of data my %seen; # lookup table my @aonly; # info only in list @A my @bonly; # info only in list @B # build lookup table @seen{@B} = ( ); foreach $item (@A) { push(@aonly, $item) unless exists $seen{$item}; } %seen = (); @seen{@A} = ( ); foreach $item (@B) { push(@bonly, $item) unless exists $seen{$item}; } #@aonly = unique to DB list - @A #@bonly = unique to array of data - @B #continue on your merry way...
-baztastic

Replies are listed 'Best First'.
Re^2: list comparisons
by 1source (Initiate) on Mar 09, 2005 at 16:39 UTC
    Thanks a mil...that points me in the right direction.