in reply to Re^5: Repeated code blocks in long and hairy regex
in thread Repeated code blocks in long and hairy regex

I created a small test case for which I was able to "see" what was going on. The qr// quote method does alter the expression, but I did not see why this would have changed the matching. However, the q// did not alter the regex, and it did work as expected in the test substitution. I think I'll be switching to that, and then carefully checking through to see if something else had been inadvertently affected when swapping the code blocks for variables. It seems inevitable that something changed that managed to escape my notice. With nearly 500 lines in the original code, and having swapped out already in many places, this could be a bit tedious.

NOTE TO SELF: For future reference, qq//, qr//, and qw// all had different results (shouldn't be too surprising). The qw// and the q// had the same result.

Thank you for your suggestions.

Blessings,

~Polyglot~

  • Comment on Re^6: Repeated code blocks in long and hairy regex

Replies are listed 'Best First'.
Re^7: Repeated code blocks in long and hairy regex
by Corion (Patriarch) on Nov 05, 2023 at 14:26 UTC

    ... q// and qr// do different things. You might want to read perlop on what they do, especially on qr and q.