my %hash; @hash{ map { $_->[0] } @listA } = ( 1 ) x @listA; grep{ 1 unless defined $hash{$_->[0]} } @listB;