my $pdf = CAM::PDF->new($path_to_temp . $title);# Init an object my $pages = $pdf->numPages; # get pages to search $ii = 1; # init the index to PDF pages while ($ii < $pages) { # loop while more pages $PageText = $pdf->getPageText($ii); # get the current page text # Begin to test for skip conditions $ix = 0; # index into phrases to exclude # start a while loop for each exclude while ( $ix < $ExcludCnt) { # start the loop while more phrases $phrase = $Exclud[$ix]; # move the phrase to a variable chomp $phrase; # remove the new line character if ($PageText =~ /$phrase/i ) { # test the current phrase on the current page print " found ", $phrase; # found a phrase $skip = 1; # set to skip the url $orgcnt++; # update a counter last; # end the phrase loop } # end the if page text } # end the while more phrases continue { # continue to next exclude phrase $ix++; # increment the phrase index } # end the continue next exclude last if $skip == 1; # end the pdf page loop } # end while PDF pages continue { $ii++ ; # get the next PDF page and do it again }