PATCH: [perl #119101] Extraneous warnings in Parse::ErrorString::Perl

(Since 5.18.0)

This is from https://rt.cpan.org/Ticket/Display.html?id=87458.

Working on this ticket caused me to be more certain of the advisability
of the deprecation message that was added in v5.18.0, and which was
inappropriately being raised in the test suite for this module.

The message notes that escaping the metacharacter '{', '[', or '(')
doesn't actually do anything in a pattern whose delimiters are {} [] or
() respectively.

The code in question looked something like

    my $pat = "m{\Q$foo}";
    ...
    eval "$bar =~ $pat";

where $foo comes from somewhere else and contained something like
\x{61}.  The message should not be raised because the \Q changes that to
\\x\{61\}, and so the \x loses its special meaning as well, and the left
brace is not a metacharacter in this context.  The solution is to look
at all the backslashes before the 'x' and only raise the message if
there are an odd number of them.

But, if $foo had been something like "bar{3}", the \Q would have
transformed that into "bar\{3\}.  In the code above, this matches
"b" followed by "a" followed by 3 "r"s.

Similarly for [] and ().

    my $foo = "(abc)";
    my $pat = "m(\Q$foo)";
    ...
    eval "$bar =~ $pat";

will not match the parens in $foo literally, but treat them as marking a
group.

The bottom line is that currently you cannot rely on \Q to properly
quote in a regex pattern in which the delimiters are mirrored
metacharacters.  The only current safe mirrored delimiters are <>, which
are not metacharacters.  Starting in 5.18.0, there is a default-on
message that catches this.  Starting with this commit, certain false
positives have been removed, and I know of none other.