Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^3: Unrecognized escape \Q passed through in regex ('interpolations")

by tye (Sage)
on Jan 27, 2006 at 04:00 UTC ( [id://525895]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://525895]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2024-04-23 07:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found