develooper Front page | perl.perl5.porters | Postings from December 2011

Re: [perl #107262] Unmatched \Q \E in regexp should warn

Thread Previous | Thread Next
December 29, 2011 03:08
Re: [perl #107262] Unmatched \Q \E in regexp should warn
Message ID:
On 29 December 2011 11:48, Ed Avis <> wrote:
> I expected a warning from these because \Q and \E are not matched:
> % perl -wE '$_ = "a"; /\Qa/ or die'
> % perl -wE '$_ = "a"; /a\E/ or die'
> I suggest that at the end of the regexp, if a \Q is still open then
> warn.
> If \E is found but there was no active \Q \l \u \L \U then warn.
> Maybe there shouldn't be a warning for unclosed \l and so on, since
> that is not a quoting mechanism in the same way as \Q...\E.

This construct is not regexp specific, and does not warn in other situations.

perl -le'my $x="\Qfoo[]"; print $x'

IMO, not-a-bug.


perl -Mre=debug -e "/just|another|perl|hacker/"

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About