Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

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

by tye (Sage)
on Jan 27, 2006 at 04:00 UTC ( #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? | Other CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2022-01-19 21:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (56 votes). Check out past polls.

    Notices?