use File::Slurp; my $text = read_file( 'filename' ) ; #### if (($text !~ m/$nameOne/) && ($text !~ m/$nameTwo)) { print "$name\n"; $ct++; }