in reply to Re: Re: Dynamic regexp from array values
in thread Dynamic regexp from array values

Actually my $regex = qr(join '|', map "\Q$_\E", @vals) will optimize the pattern matching

Unfortunately I'll be a totally different pattern though. Dispite the looks of it, qr() is not a function call. It's a quote operator with () as delimiters. You need to either interpolate the join() call (with e.g. @{[join ...]}), or just do $regex = qr/$regex/.

Update: Had misplaced the parenthesis.

ihb