in reply to Scope and Context

1) Never use statment modifies on my declarations:     my @match= whatever   if whyever; does weird things when whyever is false. Such usage may become an error (or warning) in future releases of Perl.

2) If you use eval, then you usually need to check and report $@ (you can report it in a non-fatal way).

3) I don't like any of the uses of map (even those in replies). They all (that I saw) modified $_ inside the map. Several alternatives are possible:

chomp( my @lines= <FH> ); return map qr/$_/, @lines;
or
return map { chomp( my $line= $_ ); qr/$line/; } <FH>;
to show a couple. You can do the chomp on a separate line from the my in either of those cases if you prefer.

        - tye (but my friends call me "Tye")