#!/usr/bin/perl use strict; use warnings; my $input_file = "/home/User/Documents/fakeDir/test_urls.txt"; my @RESULTS; open(INPUT, "< $input_file") or die "Error: There was an error opening the input file: $!\n\n"; my $x = 0; while () { my $line = "$_"; chomp($line); ### INCLUDE STATEMENT: if ($line =~ /^(http:\/\/)?(www\.)?fakesite.com.*/g) { print "CHECKING --> '$line'\n"; ### EXCLUDE STATEMENT: # *Original Regex went here instead: # --> if ($line !~ /$ORINGAL-REGEX/g) if ($line =~ /files-png/g) { print "\t\tFOUND IT....\n\n"; $RESULTS[$x] = "$line"; $x++; } else { print "\t\tNOT FOUND....\n\n"; } } } close INPUT;