perlre explains why this is not permitted, and how to make it permitted if you really want to do it...
$string =~ /$re/; Before Perl knew how to execute interpolated code within a pattern, this operation was com pletely safe from a security point of view, although it could raise an exception from an illegal pattern. If you turn on the "use re 'eval'", though, it is no longer secure, so you should only do so if you are also using taint checking. Better yet, use the carefully con strained evaluation within a Safe module. See perlsec for details about both these mechanisms.
| We're not surrounded, we're in a target-rich environment! |
|---|
In reply to Re: Regular Expression Question
by jasonk
in thread Regular Expression Question
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |