my $regexp = shift; my $text = shift; open RE, $regexp; while() { chomp; push @re, $_ } close RE; open TXT, $text; while() { for my $re (@re) { print if m!$re! } } close TXT