in reply to Compare two index lists

The data set seems small enough. You can store all the list data in a hash. Since the hash key is unique you won't hjave duplicate data when you get the keys. You can use the value field to store the number of times the data is found.
use strict; use warnings; my @list_a = ( 'a'..'g'); my @list_b = ( 'A'..'C', 'a'..'c'); my %count; $count{$_}++ foreach (@list_a, @list_b); foreach (sort keys %count) { print "$_ appears $count{$_} time.\n" if $count{$_} == 1; }

Replies are listed 'Best First'.
Re: Re: Compare two index lists
by princepawn (Parson) on Aug 11, 2003 at 17:41 UTC
    He used regular expressionn matching... so your example is fine if the hash is tied via Tie::Hash::Regex or Tie::Hash::Approx, but otherwise...

    Carter's compass: I know I'm on the right track when by deleting something, I'm adding functionality

      I agree but it seemed like he was looking for any solution that worked. "I have used different methods of looking for a match.(eq, ==, /^var2$/)". Thanks for pointing it out.