my @regexes; # read in open RE, "< my_re.pl" or die "can't read my_re.pl: $!"; while() { chomp; push @regexes, eval; } close RE; # and do the matching for my $re (@regexes) { if ($text =~ $re) { # do something } }