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