in reply to Re^3: A variable name in a regex comment triggers a warning
in thread A variable name in a regex comment triggers a warning

Thank you for the explanation, which was very clear and made perfect sense. I think I now understand what is going on. Is variable interpolation suppressed inside a (?#...) construct? That would explain why it stopped the warning. Let's see

$ perl -wle'use re "debug"; $x = "foo\nbar"; qr/(?x)hullo (?#there $x) +/' Compiling REx `(?x)hullo (?#there $x)' size 4 Got 36 bytes for offset annotations. first at 1 1: EXACT <hullo>(4) 4: END(0) anchored `hullo' at 0 (checking anchored isall) minlen 5 Offsets: [4] 5[6] 0[0] 0[0] 23[0] Name "main::x" used only once: possible typo at -e line 1. Freeing REx: `"(?x)hullo (?#there $x)"'

Looks like it is. Thanks again for the explanation. I know now what to avoid.

Cheers,

JohnGG