http://qs321.pair.com?node_id=525895


in reply to Re^2: Unrecognized escape \Q passed through in regex
in thread Unrecognized escape \Q passed through in regex

\Q and \E don't work inside interpolations. They only work in regexp literals
Fascinating theory, but easily proven wrong:
print "\Qabc*def­\E\n"; # prints abc\*def

Your example shows a \Q being used inside of a quoted string, not inside of a string value being interpolated (into a string or regex). You've misunderstood how "interpolation" was originally used.

I'll agree that the original use of "interpolation" wasn't clear enough. Though, double-quoted strings allow interpolation but I wouldn't call a quoted string that didn't contain any variables "an intepolation".

- tye        

  • Comment on Re^3: Unrecognized escape \Q passed through in regex ('interpolations")
  • Download Code