in reply to Re: Regex Substitution, Interpolating on the RHS?
in thread Regex Substitution, Interpolating on the RHS?

Wow. Interesting stuff. Double quotes, double-e... Thank you.


($_='kkvvttuu bbooppuuiiffss qqffssmm iibbddllffss')
=~y~b-v~a-z~s; print
  • Comment on Re^2: Regex Substitution, Interpolating on the RHS?

Replies are listed 'Best First'.
Re^3: Regex Substitution, Interpolating on the RHS?
by diotalevi (Canon) on Jul 18, 2005 at 13:04 UTC

    You should realize this means you're building source code on the fly and evaling it. Its a serious security and correctness issue. The following is equivalent and makes the string-eval more visible than just the second /e would. The first /e is completely different in character than the second /e.

    s<$regex->[0]>{ eval qq["$regex->[1]"]; }e