in reply to Re^2: use qr// variable in right side of s/// operator
in thread use qr// variable in right side of s/// operator

Well, all the /e's evaluate the replacement string as Perl code. :)

--
brian d foy <brian@stonehenge.com>
Subscribe to The Perl Review
  • Comment on Re^3: use qr// variable in right side of s/// operator

Replies are listed 'Best First'.
Re^4: use qr// variable in right side of s/// operator
by ikegami (Patriarch) on Feb 15, 2006 at 20:24 UTC

    The first 'e' causes $str_regexp to be evaluated as Perl code. In other words, it uses the value of $str_regexp as the replacement string. That is compiled along with the rest of the program. There's no risk to this.

    The second 'e' causes the content of $str_regexp to be evaluated as Perl code. Since that could have come from anywhere, this is very dangerous.