in reply to comparing lists and getting an exemtion report

How big are these lists? If they're not incredibly large, something like this should work:

# Assuming @list_a and @list_b my %b; $b{$_} = 1 foreach (@list_b); my @list_c; foreach (@list_a) { push @list_c, $_ unless $b{$_}; }

Replies are listed 'Best First'.
Re^2: comparing lists and getting an exemtion report
by brx (Pilgrim) on Apr 20, 2012 at 19:43 UTC
    # Assuming @list_a and @list_b my %b; $b{$_} = 1 foreach (@list_b); my @list_c = grep { not $b{$_} } @list_a;