http://www.perlmonks.org?node_id=785935


in reply to Re^2: qr// and user provided regex patterns...
in thread qr// and user provided regex patterns...

Using the eval works great for matches : $pattern = eval "qr$pattern" or die $@;

No, it doesn't.

First of all, it doesn't work at all if $pattern actually contains a pattern.

And then there are issues with improper escaping. If you pass /a\+/, it won't match "a" followed by "+" as desired.