/x apparently has no effect. \Q is what affects the space (for \Q implies to quote any characters following it, till the end or upto \E if present).

# Need perl to be built with DEBUGGING perl -Dr -e '$p = qr{\Q ++ \E} ; $q = qr{\Q ++ \E}x ; $r = qr{\Q++\E}' Compiling REx `\ \+\+\ ' size 3 Got 28 bytes for offset annotations. first at 1 rarest char + at 1 1: EXACT < ++ >(3) 3: END(0) anchored " ++ " at 0 (checking anchored isall) minlen 4 Offsets: [3] 1[8] 0[0] 9[0] Compiling REx `\ \+\+\ ' size 3 Got 28 bytes for offset annotations. first at 1 rarest char + at 1 1: EXACT < ++ >(3) 3: END(0) anchored " ++ " at 0 (checking anchored isall) minlen 4 Offsets: [3] 1[8] 0[0] 9[0] Compiling REx `\+\+' size 3 Got 28 bytes for offset annotations. first at 1 rarest char + at 0 1: EXACT <++>(3) 3: END(0) anchored "++" at 0 (checking anchored isall) minlen 2 Offsets: [3] 1[4] 0[0] 5[0] Omitting $` $& $' support. EXECUTING... Freeing REx: `"\\ \\+\\+\\ "' Freeing REx: `"\\ \\+\\+\\ "' Freeing REx: `"\\+\\+"'

I consulted perlre to see if there was anything about a space with \Q & /x. Finding nothing there, I moved to the pointer provided to Gory details of parsing quoted constructs in perlop. That section also did not list anything about the topic. The reading of that section, however, was interesting. All was not in vain.


In reply to Re: /x modifier with \Q and \E by parv
in thread /x modifier with \Q and \E by wardy3

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.