Wouldn't this also fail if $chompstr contained \E ?
No, it's magic:
use strict; use warnings; my $str = 'foo\E**** <- this is a syntax error'; if ("foo" !~ m/\Q$str\E/){ print "No syntax error\n"; } __END__ No syntax error
If the quoting had stopped by the embedded \E, you'd get the Nested quantifiers in regex error.
In reply to Re^3: Chomping Frenzy question
by moritz
in thread Chomping Frenzy question
by rovf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |