example 1: blah (foobar) blah example 2: blah (foo all sorts of content on lots of lines of data bar) blah #### my $regex_string = join '|', @list_patterns; open( FILE, "<", $arg1 ) or die "$arg1: $!"; $_ = do { local $/; }; # temporarily set $/ = undef to slurp file close FILE; if ( /($regex_string)/is ) { # got a match... } #### my $list_regex = qr/($regex_string)/is; ... if ( /$list_regex/ ) { ...