in reply to RegEx Perl Code
When you ran your code, you probably got this error:
Basically, Perl really doesn't like running code that was interpolated into a string. Since a scalar used in a regex could very likely be input by a user, Perl avoids doing any sort of double interpolation (first interpolate the scalar into the regex, then run the code). If you do putEval-group not allowed at runtime, use re 'eval' in regex m/some((?{pr +int "Hey!";})/ at - line 6.
because you know what you're doing, and put the paren at the end of the string that you seemed to forget, the code does what you expect.use eval 're';
|
|---|