use strict; use warnings; my $filename = 'file.txt'; open(FH, '<', $filename) or die "$filename: $!"; my $text = do { local $/; }; close(FH); my @patterns = qw(january february egypt a.*e (.*?) etc); print map { $text =~ /$_/ ? "$_: found\n" : "$_: not found\n" } @patterns; __END__ january: found february: found egypt: found a.*e: not found (.*?): not found etc: not found