Have you printed the two values you get?The output is above in the end block.
I'm pretty sure that by "the two values", Corion meant $regex1 and $regex2.
By the way, the only quoting construct that doesn't interpolate at all is here docs with a single-quoted delimiter:
chomp( my $regex2 = <<'ENDREGEX' ); (?:(?|(?:\")([^\\\"]*(?:\\.[^\\\"]*)*)(?:\"))) ENDREGEX print $regex2, "\n"; my ($match2) = q|"hubba \"bubba\""| =~ /$regex2/; print $match2, "\n"; __END__ (?:(?|(?:\")([^\\\"]*(?:\\.[^\\\"]*)*)(?:\"))) hubba \"bubba\"
In reply to Re^3: regex compilation
by haukex
in thread regex compilation
by morgon
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |