{ my %data; @data{@data} = 1; # turn @data into a lookup hash foreach ( @data2 ) { print "This $_ was not found.\n" if not exists $data{$_} } }