in reply to /x modifier with \Q and \E

From perlre:
Also note that anything inside a \Q...\E stays unaffected by /x.
In other words, whitespace IS significant inside quotemeta, regardless of /x.

     "As you get older three things happen. The first is your memory goes, and I can't remember the other two... " - Sir Norman Wisdom

Replies are listed 'Best First'.
Re^2: /x modifier with \Q and \E
by wardy3 (Scribe) on Apr 01, 2008 at 05:47 UTC
    aaaaaahhh! Thanks

    My version of perldoc doesn't have that sentence! I just checked online and the sentence is there. Must have been updated since my Perl.

    Thanks again.

Re^2: /x modifier with \Q and \E
by parv (Parson) on Apr 01, 2008 at 05:58 UTC

    (I missed OP's reply which stated the same as below.)

    I could not find that line in my copies of perlre or perlop (perl 5.8.7) ...

    { perldoc perlre ; perldoc perlop ; } | grep -C 2 unaffected just as in ordinary Perl code. This also means that if you wan +t real whitespace or "#" characters in the pattern (outside a characte +r class, where they are unaffected by "/x"), that you'll either have to +escape them or encode them using octal or hex escapes. Taken together +, these features go a long way towards making Perl's regular expression +s more -- cards, pipes, and redirections will be honored. The co +llected standard output of the command is returned; standard er +ror is unaffected. In scalar context, it comes back as a sing +le (potentially multi-line) string, or undef if the comman +d failed. In list context, returns a list of lines (howe +ver