in reply to What do \Q and \E mean?
In a regular expression, all chars between the \Q and \E are escaped. See quotemeta in perlfunc.
In your code sample, you are appending a string, that looks like a regular expression, onto the end of $code.
update
I couldn't find my Perl Cookbook, must have left it at work, however, the code you are referring to is probably assembling a regex so it then can eval it. I seem to remember it was showing some way of performing efficient variable regex's.
Re^2: What do \Q and \E mean?
by apt_get (Acolyte) on Jun 19, 2005 at 03:25 UTC
|
Well, the code is from a script that for an input file, translates a string found in a set of strings ($in) to a corresponding string found in another set of strings ($out), which have been created elsewhere, with appropriate mappings. Example 1.4 from the Perl Cookbook. Sorry for not posting more code, just wanted clarification on those weird (now clear) \Q and \E switches. | [reply] |
|