{ my %data; undef @data{@data}; foreach ( @data2 ) { print "This $_ was not found.\n" if not exists $data{$_} } }