myPerlScript.pl -input_file myInputFile.txt -pats "^atlas\S+/ || /\/world\s+/ || /\nowhere\s+" #### .... .... forach my $hashkey (keys %myHash) { if($hashkey !~ /$pat/) { print "no Match $hashkey\n"; } }