my @list1 = get_from_some_place(); my @list2 = get_from_some_other_place(); -------- # Hash method my %lookup_hash; @lookup_hash{@list2} = undef; # This is a hashslice. We don't care about the values. unless (exists $lookup_hash{$list1[0]}) { # Do something here } -------- # grep method unless (grep { $_ eq $list1[0] } @list2) { # Do something here }