Undoubtedly, there is an easier way to do it, but that's what springs to mind. Using qr// allows you to compile the regex only once if you re-use the same results (and regex) over and over.my $results = join "|", @results; my $results_re = qr/$results/; ... if ( $name =~ /$results_re/ ) { ... }
In reply to Re: Creating regex from arrays
by Kageneko
in thread Creating regex from arrays
by debiandude
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |