in reply to More than one regexp.

Well, most people have pointed out the qr// operator, but didn't notice that you wanted to print your re's if matched, not the input. However, you can still speed up your matching by using qr//:

#!/usr/bin/perl -w use strict; my @patterns = qw/ ^foo bar x.*?z /; @patterns = map{qr/$_/}@patterns; my $input = 'fooxbaz'; foreach my $re (@patterns){ print "$re\n" if $input =~ /$re/; }

The re's you get back aren't exactly the same as the pattern strings originally provided (notably they'll have '(?-ixsm)' appended to them to indicate which modifiers were present (or not in this case) when compiled).