in reply to Weird quoting with /x modifier

"#" (like "$" and "@") apparently has higher precedence than "\Q". You assumed the opposite.

Replies are listed 'Best First'.
Re^2: Weird quoting with /x modifier
by ykar (Acolyte) on May 31, 2010 at 08:24 UTC

    I don't think so.

    It is said that # should be backslashed or quoted with \Q..\E in perlre. So if # actually have higher precedence in regexp with /x modifier it is a bug, because it does not work as stated.

    Second. If # had higher precedence than \Q..\E, string was just trimmed after the # character.

      So if # actually have higher precedence in regexp with /x modifier it is a bug, because it does not work as stated.

      True. You can use perlbug to file a report.

      If # had higher precedence than \Q..\E, string was just trimmed after the # character.

      False. "#" doesn't trim anything.

      >perl -e"print qr/4d#sd/x" (?x-ism:4d#sd )