my $regexp; foreach( @regexps ) # Your regexps, from file. { eval "\$regexp = qr/$_/;" or die "Regexp error with regexp '$_': $@"; # ... use the regexp, it has passed QC: &do_stuff() if( $testline =~ $regexp ); }