#!/usr/bin/perl use strict; use warnings; use File::Find; my $dir = '\webdirectory'; my $nameOne = 'alpha beta'; my $nameTwo = 'charlie'; my @pages; sub mySub { return if -d $File::Find::name; return if $File::Find::name !~ /\.html$/; my $text; open (IN, $File::Find::name) or die "Can't open '$File::Find::name': $!\n"; { local $/; # Slurp-Mode $text = ; } close IN or die $!; if ($text !~ m/\Q$nameOne\E/ and $text !~ m/\Q$nameTwo\E/) { push @pages, $File::Find::name; } } find( \&mySub, $dir ); print "$_\n" for @pages;