Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No deprecation warning on literal left curly bracket in /.{/ etc #15349

Closed
p5pRT opened this issue May 22, 2016 · 32 comments
Closed

No deprecation warning on literal left curly bracket in /.{/ etc #15349

p5pRT opened this issue May 22, 2016 · 32 comments

Comments

@p5pRT
Copy link

p5pRT commented May 22, 2016

Migrated from rt.perl.org#128213 (status was 'resolved')

Searchable as RT128213$

@p5pRT
Copy link
Author

p5pRT commented May 22, 2016

From @trwyant

Created by @trwyant

As I understand it, literal left curly brackets in regular expressions
were deprecated in Perl 5.22, and with Perl 5.25.1 they produced a
compile error. However, it appears that there is no warning (under
5.24.0) or error (under 5.25.1) for the following​:

/.{/
/[x]{/
/[xy]{/
/\p{Latin}{/

Compilation of these under 'use re debug' appears to show that the
curlys are compiled as literals. Examples of this are appended. I note
that /x(?​:{)/ also produces no warning/exception, but I understand this
to be an instance of the exception for leading curlys.

Is all this a misunderstanding of the deprecation on my part? Or an
obscure code path missed in the deprecation? If the former, please
accept my apologies for wasting your time. And in either case, thank you
very much for making Perl what it is today.

Appended example​:

$ perl -c -Mre=debug -e '/.{/'
Compiling REx ".{"
Final program​:
  1​: REG_ANY (2)
  2​: EXACT <{> (4)
  4​: END (0)
anchored "{" at 1 (checking anchored) minlen 2
-e syntax OK
Freeing REx​: ".{"

$ # but

$ perl -c -Mre=debug -e '/x{/'
Compiling REx "x{"
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/x{ <-- HERE / at -e line 1.
Final program​:
  1​: EXACT <x{> (3)
  3​: END (0)
anchored "x{" at 0 (checking anchored isall) minlen 2
-e syntax OK
Freeing REx​: "x{"

Perl Info

Flags:
    category=core
    severity=low

Site configuration information for perl 5.24.0:

Configured by tom at Mon May  9 16:46:19 EDT 2016.

Summary of my perl5 (revision 5 version 24 subversion 0) configuration:
   
  Platform:
    osname=darwin, osvers=15.4.0, archname=darwin-2level
    uname='darwin samwise.local 15.4.0 darwin kernel version 15.4.0: fri feb 26 22:08:05 pst 2016; root:xnu-3248.40.184~3release_x86_64 x86_64 '
    config_args='-Dprefix=/trw/local/perl/5.24.0 -Dcf_email=wyant@cpan.org -d'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-fno-common -DPERL_DARWIN -mmacosx-version-min=10.11 -fno-strict-aliasing -pipe -fstack-protector-strong -I/opt/local/include -DPERL_USE_SAFE_PUTENV',
    optimize='-O3',
    cppflags='-fno-common -DPERL_DARWIN -mmacosx-version-min=10.11 -fno-strict-aliasing -pipe -fstack-protector-strong -I/opt/local/include'
    ccversion='', gccversion='4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.31)', gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678, doublekind=3
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16, longdblkind=3
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -mmacosx-version-min=10.11 -fstack-protector-strong -L/opt/local/lib'
    libpth=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/7.3.0/lib /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib /usr/lib /opt/local/lib
    libs=-lpthread -lgdbm -ldbm -ldl -lm -lutil -lc
    perllibs=-lpthread -ldl -lm -lutil -lc
    libc=, so=dylib, useshrplib=false, libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags=' -mmacosx-version-min=10.11 -bundle -undefined dynamic_lookup -L/opt/local/lib -fstack-protector-strong'



@INC for perl 5.24.0:
    /trw/local/perl/5.24.0/lib/site_perl/5.24.0/darwin-2level
    /trw/local/perl/5.24.0/lib/site_perl/5.24.0
    /trw/local/perl/5.24.0/lib/5.24.0/darwin-2level
    /trw/local/perl/5.24.0/lib/5.24.0
    .


Environment for perl 5.24.0:
    DYLD_LIBRARY_PATH (unset)
    HOME=/Users/tom
    LANG=en_US.UTF-8
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/trw/local/perl/5.24.0/bin:/trw/local/lynx/2.8.8-with-ssl/bin:/trw/local/perl6/2015.12/bin:/trw/local/perl6/2015.12/share/perl6/site/bin:/trw/local/simh/3.9-0/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/tom/Code/Tools
    PERLPKGOPT=-noppm
    PERL_BADLANG (unset)
    SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented May 23, 2016

From @jkeenan

On Sun May 22 13​:14​:54 2016, wyant wrote​:

This is a bug report for perl from wyant@​cpan.org,
generated with the help of perlbug 1.40 running under perl 5.24.0.

-----------------------------------------------------------------
[Please describe your issue here]

As I understand it, literal left curly brackets in regular expressions
were deprecated in Perl 5.22, and with Perl 5.25.1 they produced a
compile error. However, it appears that there is no warning (under
5.24.0) or error (under 5.25.1) for the following​:

/.{/
/[x]{/
/[xy]{/
/\p{Latin}{/

Compilation of these under 'use re debug' appears to show that the
curlys are compiled as literals. Examples of this are appended. I note
that /x(?​:{)/ also produces no warning/exception, but I understand
this
to be an instance of the exception for leading curlys.

Is all this a misunderstanding of the deprecation on my part? Or an
obscure code path missed in the deprecation? If the former, please
accept my apologies for wasting your time. And in either case, thank
you
very much for making Perl what it is today.

Appended example​:

$ perl -c -Mre=debug -e '/.{/'
Compiling REx ".{"
Final program​:
1​: REG_ANY (2)
2​: EXACT <{> (4)
4​: END (0)
anchored "{" at 1 (checking anchored) minlen 2
-e syntax OK
Freeing REx​: ".{"

$ # but

$ perl -c -Mre=debug -e '/x{/'
Compiling REx "x{"
Unescaped left brace in regex is deprecated, passed through in regex;
marked by <-- HERE in m/x{ <-- HERE / at -e line 1.
Final program​:
1​: EXACT <x{> (3)
3​: END (0)
anchored "x{" at 0 (checking anchored isall) minlen 2
-e syntax OK
Freeing REx​: "x{"

I can confirm your observations that no exceptions are thrown in these instances in perl 5.24.0. I can also confirm your observations re "perl -c -Mre=debug -e ...".

I am not a regex expert and didn't follow the discussion of this feature. But I suspect this may be a case where the error message is not sufficiently precise as to the error condition.

If we look at the source code we see this starting at line 13190 of 'regcomp.c'​:

#####
  case '{'​:
  /* Currently we don't care if the lbrace is at the start
  * of a construct. This catches it in the middle of a
  * literal string, or when it's the first thing after
  * something like "\b" */
  if (len || (p > RExC_start && isALPHA_A(*(p -1)))) {
  RExC_parse = p + 1;
  vFAIL("Unescaped left brace in regex is illegal");
  }
  /*FALLTHROUGH*/
  default​: /* A literal character */
#####

The term 'construct' is used (as both noun and verb) throughout the inline comments in this file but I didn't see a precise definition of its noun version. I'm also not entirely clear as to what 'literal string' and 'something like "\b"' mean. But I would hazard a guess that in the examples you cite, the characters preceding the unescaped left brace, i.e.,

#####
.
[x]
[xy]
\p{Latin}
#####

... because they are all regex-y things, disqualify these from being 'literal strings' and thus do not qualify as an error conditions.

Pinging our regex experts!

Thank you very much.

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented May 23, 2016

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented May 23, 2016

From @demerphq

This was a change made by Karl, but personally i consider this discrepancy
to be undesirable. Karl would have to confirm the intent here however.

Yves
On 22 May 2016 20​:28, "James E Keenan via RT" <perlbug-followup@​perl.org>
wrote​:

On Sun May 22 13​:14​:54 2016, wyant wrote​:

This is a bug report for perl from wyant@​cpan.org,
generated with the help of perlbug 1.40 running under perl 5.24.0.

-----------------------------------------------------------------
[Please describe your issue here]

As I understand it, literal left curly brackets in regular expressions
were deprecated in Perl 5.22, and with Perl 5.25.1 they produced a
compile error. However, it appears that there is no warning (under
5.24.0) or error (under 5.25.1) for the following​:

/.{/
/[x]{/
/[xy]{/
/\p{Latin}{/

Compilation of these under 'use re debug' appears to show that the
curlys are compiled as literals. Examples of this are appended. I note
that /x(?​:{)/ also produces no warning/exception, but I understand
this
to be an instance of the exception for leading curlys.

Is all this a misunderstanding of the deprecation on my part? Or an
obscure code path missed in the deprecation? If the former, please
accept my apologies for wasting your time. And in either case, thank
you
very much for making Perl what it is today.

Appended example​:

$ perl -c -Mre=debug -e '/.{/'
Compiling REx ".{"
Final program​:
1​: REG_ANY (2)
2​: EXACT <{> (4)
4​: END (0)
anchored "{" at 1 (checking anchored) minlen 2
-e syntax OK
Freeing REx​: ".{"

$ # but

$ perl -c -Mre=debug -e '/x{/'
Compiling REx "x{"
Unescaped left brace in regex is deprecated, passed through in regex;
marked by <-- HERE in m/x{ <-- HERE / at -e line 1.
Final program​:
1​: EXACT <x{> (3)
3​: END (0)
anchored "x{" at 0 (checking anchored isall) minlen 2
-e syntax OK
Freeing REx​: "x{"

I can confirm your observations that no exceptions are thrown in these
instances in perl 5.24.0. I can also confirm your observations re "perl -c
-Mre=debug -e ...".

I am not a regex expert and didn't follow the discussion of this feature.
But I suspect this may be a case where the error message is not
sufficiently precise as to the error condition.

If we look at the source code we see this starting at line 13190 of
'regcomp.c'​:

#####
  case '{'​:
  /* Currently we don't care if the lbrace is at the start
  * of a construct. This catches it in the middle of a
  * literal string, or when it's the first thing after
  * something like "\b" */
  if (len || (p > RExC_start && isALPHA_A(*(p -1)))) {
  RExC_parse = p + 1;
  vFAIL("Unescaped left brace in regex is illegal");
  }
  /*FALLTHROUGH*/
  default​: /* A literal character */
#####

The term 'construct' is used (as both noun and verb) throughout the inline
comments in this file but I didn't see a precise definition of its noun
version. I'm also not entirely clear as to what 'literal string' and
'something like "\b"' mean. But I would hazard a guess that in the
examples you cite, the characters preceding the unescaped left brace, i.e.,

#####
.
[x]
[xy]
\p{Latin}
#####

... because they are all regex-y things, disqualify these from being
'literal strings' and thus do not qualify as an error conditions.

Pinging our regex experts!

Thank you very much.

--
James E Keenan (jkeenan@​cpan.org)


via perlbug​: queue​: perl5 status​: new
https://rt-archive.perl.org/perl5/Ticket/Display.html?id=128213

@p5pRT
Copy link
Author

p5pRT commented May 23, 2016

From @trwyant

FWIW​:

$ perl -c -Mre=debug -e '/\d{/'
Compiling REx "\d{"
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\d{ <-- HERE / at -e line 1.
Final program​:
  1​: POSIXU[\d] (2)
  2​: EXACT <{> (4)
  4​: END (0)
anchored "{" at 1 (checking anchored) stclass POSIXU[\d] minlen 2
-e syntax OK
Freeing REx​: "\d{"

and similarly for \D, \s, \S, \v, \V, \N, \h. Which is why I expected a warning (5.24.0) or error (5.25.1) on /.{/.

On the other hand, the comment seems to say none of these should warn. The 'Quantifiers' section of the Perl 5.24.0 and 5.25.1 perlre seems to say that all left curlys not part of a quantifier are literals and deprecated, but omits the "first character in the pattern" exception that appears in the 5.25.1 perldelta. None of which seems to help, thoug. :-(

@p5pRT
Copy link
Author

p5pRT commented May 23, 2016

From @khwilliamson

On 05/23/2016 04​:51 AM, Tom Wyant via RT wrote​:

FWIW​:

$ perl -c -Mre=debug -e '/\d{/'
Compiling REx "\d{"
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\d{ <-- HERE / at -e line 1.
Final program​:
1​: POSIXU[\d] (2)
2​: EXACT <{> (4)
4​: END (0)
anchored "{" at 1 (checking anchored) stclass POSIXU[\d] minlen 2
-e syntax OK
Freeing REx​: "\d{"

and similarly for \D, \s, \S, \v, \V, \N, \h. Which is why I expected a warning (5.24.0) or error (5.25.1) on /.{/.

On the other hand, the comment seems to say none of these should warn. The 'Quantifiers' section of the Perl 5.24.0 and 5.25.1 perlre seems to say that all left curlys not part of a quantifier are literals and deprecated, but omits the "first character in the pattern" exception that appears in the 5.25.1 perldelta. None of which seems to help, thoug. :-(

---
via perlbug​: queue​: perl5 status​: open
https://rt-archive.perl.org/perl5/Ticket/Display.html?id=128213

Thank you for finding this. If you hadn't found this now, there would
have been much bigger problems later on.

This situation is the result of oversights on my part.

The goal of the deprecation is two-fold​:
  1) to allow us to extend the language;
  2) to catch typos in {m,n} quantifiers that currently silently
compile into something unintended.

As an example of item 2), before 5.22, if you say qr/a{3, 4}/, the blank
makes it not a quantifier, and the result is to match the exact sequence
"a{3, 4}". That may or may not be what you wanted. It's quite possible
that you meant to match "a" 3 or 4 times and didn't realize that blanks
are not allowed in a quantifier. But Perl can't read your mind, and so
currently has to assume you meant the only legal interpretation. It
would also be nice to also allow spaces in quantifiers, or to make the
lower bound optional. None of those can be done today.

All the other extensions that are envisioned involve using backslash
sequences such as qr/\w{latin, greek}/. This extension would mean to
match \w, but only in the latin or greek scripts. This might be useful
in something that parses mathematical equations but wants to exclude
look-alike characters from other scripts, or for a web server that
wants to exclude look-alike malicious addresses. paypal, for example,
can be written almost entirely in cyrillic, redirecting the unwary to a
scam website.

However, { is often used in patterns to mean a literal left brace.
Making this change will disrupt existing code. See
https://rt-archive.perl.org/perl5/Ticket/Display.html?id=128139
At the time we made the decision to go ahead with this change, during
the development of 5.15, it was deemed worth the breakage.

But another goal would be to minimize this disruption. So I tried to
raise the warning only where the left brace could, with our plans, mean
something other than a literal left brace. It turns out that there is
lots of code like qr/{..../. That '{', since it's the first thing, can
only be a left brace. And similarly in qr/^{.../ or qr/ ... ({...)
.../, it can only be a left brace. So there is no need to disturb code
where there is not going to be ambiguity. And this cuts down the amount
of disruption significantly.

But what you have found is that I missed some cases where it should have
been deprecated. qr/.{3, 4}/ could have been meant to be a quantifier,
and should have warned.

We can't just forbid things like that without a deprecation cycle. I
intend to add the deprecation message for the missing cases shortly. I
believe these all involve '{' being used in quantifiers. That means
there can't be any other changes to quantifier handling until probably 5.30.

I think that 5.26 should go out with the current fatal error for the
contexts where we previously warned, and 5.28 is free to re-purpose the
'{' uses in these contexts.

And, I want to make the rule simple to follow. I think it's better to
simply say that unescaped literal '{' uses are deprecated, and then add
a caveat that this is enforced only where there is ambiguity of intent.
  The current text can be improved in that regard.

And then where's the cut off? qr/.{/ could not have been meant to be a
quantifier of '.'. But what about qr/.{3/? That could be meant to be a
quantifier. We could use an edit distance calculation to see how far
away from a legal quantifier the text is, but I don't see the need for
it. I think qr/.{/ should be deprecated, same as qr/.{3, 4}/.

@p5pRT
Copy link
Author

p5pRT commented May 23, 2016

From zefram@fysh.org

Karl Williamson wrote​:

And, I want to make the rule simple to follow.

In that case, *every* unescaped brace should be subject to the
deprecation. /^*/ and /^{3}/ both parse as a quantifier on /^/, so /^{/
should be deprecated as looking like an incomplete quantifier, just like
/.{/. /*/ and /{3}/ error as "quantifier follows nothing", so /{/ should
be deprecated as looking like an incomplete quantifier following nothing.

-zefram

@p5pRT
Copy link
Author

p5pRT commented May 24, 2016

From @trwyant

On Mon May 23 16​:09​:05 2016, zefram@​fysh.org wrote​:

Karl Williamson wrote​:

And, I want to make the rule simple to follow.

In that case, *every* unescaped brace should be subject to the
deprecation. /^*/ and /^{3}/ both parse as a quantifier on /^/, so /^{/
should be deprecated as looking like an incomplete quantifier, just like
/.{/. /*/ and /{3}/ error as "quantifier follows nothing", so /{/ should
be deprecated as looking like an incomplete quantifier following nothing.

-zefram

Boy, when I turned back the corner of this carpet I had no idea how many creepy-crawlies would come swarming out. And I appreciate very much Karl's fulsome explanation of what is going on, and support the reasons for doing the work.

The problem with applying Occam's razor is that which is the simpler alternative can depend on how you look at them.

I personally am happy with something like "un-escaped literal '{' is deprecated/removed where and only where it can introduce a quantifier." That statement means to me to mean "not at the beginning of a group (or the regex as a whole)" for sure.

Karl's addition of "... and not after an assertion" makes sense to me on the face of it, since it makes no sense (to me) to quantify an assertion. If ^ matches once at a given location, it will match any number of times. Given that, I personally, for whatever little that is worth, would look on the current parse of /^{3}/ as a bug (or at least a misfeature), and would be happy to see that sort of thing deprecated and eliminated. But that's just me, and far more Perl-savvy people than me have been wrong about such apparently-obvious things. The thing is, this could be looked at as the thin edge of the wedge, since it means a deprecation warning for '/^ {/' but not '/^ {/x'.

The funny thing is, all this was started by my desire to release a PPIx​::Regexp that shows literal '{' removed in 5.25.1 (at least, in those cases where it is in fact removed), and realizing that I did not understand either the documentation or what Perl was actually doing. My motivation may be important in evaluating my opinions, because they will almost surely be influenced by the ease or difficulty of the implementation I face. "Always removed" is certainly trivial, but "removed except at the beginning of a group and after an assertion" is not much harder.

The tricky thing may be to implement what looks like the actual removal, with some things disappearing now, and some not disappearing until 5.29.x. So if someone could let me know exactly what deprecations are being deferred, I would greatly appreciate it. Or at least, whether there is anything besides the dot, bracketed classes (including extended, which I did not check before but which also do not issue a warning) and the POSIX classes \p{...} and \P{...}.

And just as a side observation, /\b{/ is not a good example of what we're talking about, because that parse fails for a completely different reason -- after the '{' Perl is trying to complete something like /\b{wb}/ and failing.

Thank you all very much.

@p5pRT
Copy link
Author

p5pRT commented May 24, 2016

From @trwyant

In my next-to-last paragraph, s/POSIX/Unicode/g. Sorry about the proofreading.

@p5pRT
Copy link
Author

p5pRT commented May 24, 2016

From zefram@fysh.org

Tom Wyant via RT wrote​:

Karl's addition of "... and not after an assertion" makes sense to
me on the face of it, since it makes no sense (to me) to quantify an
assertion. If ^ matches once at a given location, it will match any
number of times.

That would make some sense if such a rule were being added, but it's not.
/\A/ is such an assertion, and everything you say about /^/ applies
equally to /\A/. Yet /\A{/ has been deprecated at the same time as /x{/.
There is no exception to the deprecation for assertions.

If assertions were a consistent exception, I'd still be opposed to that.
They're not an exception to quantifier syntax​: /\A{3}/ is a quantified
assertion, as is /^{3}/. We also don't have that kind of contextual
exception for other metacharacters. /*/ is an error, even though by your
logic the "*" can't possibly be intended as a quantifier because it's
at the beginning of the pattern. /[/ is an error, even though without a
"]" it can't possibly be interpreted as a character class.

"Always removed" is certainly trivial, but "removed except at the
beginning of a group and after an assertion" is not much harder.

The reality is harder than either. Implementing whatever it is isn't
going to be difficult, but finding out what it is *is*. We should make
the reality as simple as possible, to make it as easy as possible for
programmers to know it accurately.

-zefram

@p5pRT
Copy link
Author

p5pRT commented May 24, 2016

From @demerphq

On 24 May 2016 at 21​:30, Zefram <zefram@​fysh.org> wrote​:

Tom Wyant via RT wrote​:

Karl's addition of "... and not after an assertion" makes sense to
me on the face of it, since it makes no sense (to me) to quantify an
assertion. If ^ matches once at a given location, it will match any
number of times.

That would make some sense if such a rule were being added, but it's not.
/\A/ is such an assertion, and everything you say about /^/ applies
equally to /\A/. Yet /\A{/ has been deprecated at the same time as /x{/.
There is no exception to the deprecation for assertions.

If assertions were a consistent exception, I'd still be opposed to that.
They're not an exception to quantifier syntax​: /\A{3}/ is a quantified
assertion, as is /^{3}/.

While I generally agree with what you said in this post this point is
not quite right.

$ perl -wle'qr/\A{10}/'

Quantifier unexpected on zero-length expression in regex m/\A{10}/ at -e line 1.

We DO consider a quantifier on an assertion to be warnable, and IMO we
should probably do something like reduce any quantifier on an
assertion to something like ? (IOW, 0 or 1).

So

/\A{10}/

should be the same as

/\A/

and

/\A{0,10}/

should be the same as

/\A?/

Obviously we would want to propagate quantifier modifiers through as well.

cheers,
Yves

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

@p5pRT
Copy link
Author

p5pRT commented May 24, 2016

From zefram@fysh.org

demerphq wrote​:

$ perl -wle'qr/\A{10}/'

Quantifier unexpected on zero-length expression in regex m/\A{10}/ at -e line 1.

That's just a warning. It does actually parse as I stated.

should probably do something like reduce any quantifier on an
assertion to something like ? (IOW, 0 or 1).

That would be a sensible optimisation, but has essentially nothing to
do with whether it's syntactically permitted to attach a quantifier
directly to an assertion.

-zefram

@p5pRT
Copy link
Author

p5pRT commented May 24, 2016

From @demerphq

On 25 May 2016 at 01​:06, Zefram <zefram@​fysh.org> wrote​:

demerphq wrote​:

$ perl -wle'qr/\A{10}/'

Quantifier unexpected on zero-length expression in regex m/\A{10}/ at -e line 1.

That's just a warning. It does actually parse as I stated.

Yes, no argument there. My point was more that IMO it would not be
particularly unreasonable to forbid certain quantifiers on an
assertion.

IOW, I do consider use of a {min,max} quantifier on an assertion to be
exceptional, and I would not mind if we forbid it when min!=0 or
max!=1.

Yves

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

@p5pRT
Copy link
Author

p5pRT commented May 24, 2016

From zefram@fysh.org

demerphq wrote​:

Yes, no argument there. My point was more that IMO it would not be
particularly unreasonable to forbid certain quantifiers on an
assertion.

I'd be OK with syntactically forbidding quantifiers on assertions.
It'd really have to be *all* quantifiers; anything selective is more
complexity than it's worth. And it would have to be strictly syntactic,
such that one can get around the restriction by wrapping the assertion in
(?​:).

-zefram

@p5pRT
Copy link
Author

p5pRT commented May 24, 2016

From @demerphq

On 25 May 2016 at 01​:36, Zefram <zefram@​fysh.org> wrote​:

demerphq wrote​:

Yes, no argument there. My point was more that IMO it would not be
particularly unreasonable to forbid certain quantifiers on an
assertion.

I'd be OK with syntactically forbidding quantifiers on assertions.
It'd really have to be *all* quantifiers; anything selective is more
complexity than it's worth. And it would have to be strictly syntactic,
such that one can get around the restriction by wrapping the assertion in
(?​:).

Umm. I dont follow that last point...

I can understand forbidding quantifiers on an assertion, but not
allowing it if its wrapped.

Why do you think we need to support that?

Yves

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

@p5pRT
Copy link
Author

p5pRT commented May 25, 2016

From zefram@fysh.org

demerphq wrote​:

I can understand forbidding quantifiers on an assertion, but not
allowing it if its wrapped.

My point is that any forbidding of quantifiers on assertions should be a
purely syntactic effect. A quantifier is syntactically permitted on (?​:),
and must be allowed regardless of what is contained in the group. If,
instead, the forbidding of quantifiers were a semantic effect, we'd get
into much woollier territory trying to define what semantically counts as
an assertion. (/^/ is, and you'd say that /(?​:^)/ is; what about /^(?​:)/
or /^^/?) It'd be much more difficult to define what's permitted in a way
that's independent of the implementation (particularly of optimisation).
Since quantifying an assertion is actually semantically meaningful,
albeit a bit insipid, we'd also run into trouble with machine-generated
or translated code. Keeping the restriction purely syntactic avoids
all of these problems.

-zefram

@p5pRT
Copy link
Author

p5pRT commented May 25, 2016

From @demerphq

On 25 May 2016 at 02​:02, Zefram <zefram@​fysh.org> wrote​:

demerphq wrote​:

I can understand forbidding quantifiers on an assertion, but not
allowing it if its wrapped.

My point is that any forbidding of quantifiers on assertions should be a
purely syntactic effect. A quantifier is syntactically permitted on (?​:),
and must be allowed regardless of what is contained in the group. If,
instead, the forbidding of quantifiers were a semantic effect, we'd get
into much woollier territory trying to define what semantically counts as
an assertion. (/^/ is, and you'd say that /(?​:^)/ is; what about /^(?​:)/
or /^^/?) It'd be much more difficult to define what's permitted in a way
that's independent of the implementation (particularly of optimisation).
Since quantifying an assertion is actually semantically meaningful,
albeit a bit insipid, we'd also run into trouble with machine-generated
or translated code. Keeping the restriction purely syntactic avoids
all of these problems.

My first reaction to this is "Ok, I get it, and oh BTW, bonus points
for using 'insipid' in a technical discussion".

My second reaction to this is that without a quantifier or alternation
(?​:) is semantically invisible, and should that make a difference?

Eg​:

$ perl -Mre=debug -wle'qr/(?​:a)bcd/'
Compiling REx "(?​:a)bcd"
Final program​:
  1​: EXACT <abcd> (5)
  5​: END (0)
anchored "abcd" at 0 (checking anchored isall) minlen 4
Freeing REx​: "(?​:a)bcd"

So I would expect /^*/ and /(?​:^)*/ to produce the same compiled
optree, and the same errors.

But what you are saying is you would expect them to differ. Which I
guess is the difference between erroring at parse time, versus
optimization time.

But the difference makes me wonder a bit, because of things like this​:

$ perl -Mre=debug -wle'qr/(?​:a) */x'
Compiling REx "(?​:a) *"
Final program​:
  1​: STAR (4)
  2​: EXACT <a> (0)
  4​: END (0)
minlen 0
Freeing REx​: "(?​:a) *"

IOW, under /x we allow comments and whitespace to be inserted between
a construct and the quantifier. (I have argued in the past this is not
a good thing, but I lost the argument.).

So if we determine this at compile time I guess we have to do it
*after* we strip whitespace, but before we construct the optree.

Historically I have done everything I could to get us out of special
casing things based on the spelling of the pattern[1], and to instead
use the optree representation instead, so doing the opposite here
feels wrong. Although I am open minded about it.

Yves
[1] I hope this is the same as what you mean by "syntactically".

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

@p5pRT
Copy link
Author

p5pRT commented May 25, 2016

From zefram@fysh.org

demerphq wrote​:

My second reaction to this is that without a quantifier or alternation
(?​:) is semantically invisible, and should that make a difference?

It should indeed be semantically invisible, but it is *syntactically*
visible, and yes, that does and must make a difference. /(?​:ab)*/
is not the same thing as /ab*/.

So I would expect /^*/ and /(?​:^)*/ to produce the same compiled
optree, and the same errors.

If they're syntactically legal (as they currently are), they should
indeed produce the same optree, and they currently do. However, it's not
essential for them to have the same syntactic legality. Hypothetically,
if we were to forbid applying a quantifier directly to /^/, we'd be
giving /^/ the same syntactic status as an already-quantified term,
such as /a{3}/. It's not legal to apply another quantifier to /a{3}/;
/a{3}{4}/ will generate a "nested quantifiers" error, and /^{4}/ could
similarly give an error. But it's perfectly legal to *semantically*
nest quantifiers; you just need some extra grouping to get past the
syntactic hurdle. /(?​:a{3}){4}/ is legal and works, and in the same
vein /(?​:^){4}/ would have to be legal.

guess is the difference between erroring at parse time, versus
optimization time.

No, I would expect /(?​:^){4}/ not to error at all. The optimiser would
be free to reduce it to a single SBOL op, just as it is already free to
do that with /^{4}/.

Historically I have done everything I could to get us out of special
casing things based on the spelling of the pattern[1], and to instead
use the optree representation instead, so doing the opposite here
feels wrong. Although I am open minded about it.

There are some things that should be based on the parse tree of the
pattern, and others that should be based on the optree. The acceptability
of directly applying a quantifier is a syntactic matter that should be
based on the parse tree. The parse tree does not include whitespace
that is insignificant due to /x. Semantically, a quantifier is *always*
acceptable, so the optree is not a concern here. The optimiser may have
things it can usefully do with quantifiers, but those should be limited
to optimisation. The optimiser should work entirely on the optree.

-zefram

@p5pRT
Copy link
Author

p5pRT commented May 25, 2016

From @demerphq

On 25 May 2016 at 05​:31, Zefram <zefram@​fysh.org> wrote​:

demerphq wrote​:

My second reaction to this is that without a quantifier or alternation
(?​:) is semantically invisible, and should that make a difference?

It should indeed be semantically invisible, but it is *syntactically*
visible, and yes, that does and must make a difference. /(?​:ab)*/
is not the same thing as /ab*/.

Yes I know. (Hence why I said "without a quantifier or alternation")

So I would expect /^*/ and /(?​:^)*/ to produce the same compiled
optree, and the same errors.

If they're syntactically legal (as they currently are), they should
indeed produce the same optree, and they currently do. However, it's not
essential for them to have the same syntactic legality.

No its not essential. But IMO it is prima facie *saner*.

Hypothetically,
if we were to forbid applying a quantifier directly to /^/, we'd be
giving /^/ the same syntactic status as an already-quantified term,
such as /a{3}/. It's not legal to apply another quantifier to /a{3}/;
/a{3}{4}/ will generate a "nested quantifiers" error, and /^{4}/ could
similarly give an error. But it's perfectly legal to *semantically*
nest quantifiers; you just need some extra grouping to get past the
syntactic hurdle. /(?​:a{3}){4}/ is legal and works, and in the same
vein /(?​:^){4}/ would have to be legal.

Well, I dunno. This is isnt as obvious to me as it seems to be to you.
I could easily see us making /a{3}{4}/ legal and equivalent to
/(?​:a{3}){4}/ (I dont see why it should be illegal, except for
implementation convenience). And similarly I could easily see us
making /(?​:^){4}/ be treated the same as /^{4}/.

guess is the difference between erroring at parse time, versus
optimization time.

No, I would expect /(?​:^){4}/ not to error at all. The optimiser would
be free to reduce it to a single SBOL op, just as it is already free to
do that with /^{4}/.

I think that "No" is superfluous. :-) My point is that if we error at
optimisation time then we have compiled opcodes to look at, and we
would have no way to distinguish /(?​:^)*/ from /^*/, but we also
wouldn't have to worry about weird edge cases like comments or
whitespace in between the assertion and the quantifier.

Perhaps I should mention that with the way the regex engine is
implemented you have two options, do things at parse time when you
dont have an opcodes to work with, or do it at optimisation time when
you do. (I dislike calling this an "optree" as "Railway Normal Form"
really isn't very tree like).

Note that some of your arguments seem to predicated on the assumption
that if we allow /(?​:^foo)+/ we have to allow /(?​:^)+/, which isn't so
obvious to me.

Historically I have done everything I could to get us out of special
casing things based on the spelling of the pattern[1], and to instead
use the optree representation instead, so doing the opposite here
feels wrong. Although I am open minded about it.

There are some things that should be based on the parse tree of the
pattern, and others that should be based on the optree. The acceptability
of directly applying a quantifier is a syntactic matter that should be
based on the parse tree.

There is no parse tree in the regex engine. :-(

Adding one is on my todo list. :-)

The parse tree does not include whitespace
that is insignificant due to /x.

The opcodes produced do not include the whitespace.

Semantically, a quantifier is *always*
acceptable, so the optree is not a concern here. The optimiser may have
things it can usefully do with quantifiers, but those should be limited
to optimisation. The optimiser should work entirely on the optree.

Again there is no optree in the regex engine. Not in the classic sense
of the term optree. We go directly from parse to compiled opcodes, and
then we optimise the opcodes. IOW, the compiled program and the
"optree" are one and the same.

Anyway, I will have to think about this a bit, I think I am generally
with you but not everything is as clear to me as it seems to be to
you. (For those reading along it might be worth noting that one needs
to consider more types of assertion than simply "start of line" or
"end of line".)

No doubt in a day or two I will say something like "I get Zefram's
point now, and we should do what he suggests". I do appreciate you
taking the time to explain!

Cheers!
Yves

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

@p5pRT
Copy link
Author

p5pRT commented May 25, 2016

From @epa

FWIW, I can imagine cases where you build up a regexp from smaller ones, which
might be provided by a library. This means I tend to support Zefram's view
that any restriction on quantifiers must be purely syntactic, since you might
have

  /(?​:$RE{whatever}){1,2}/;

and if $RE{whatever} changes under the covers to be just /^/ then this breaks.
(As for how that might come about, use your imagination, let's just accept
that these things sometimes happen.)

--
Ed Avis <eda@​waniasset.com>

@p5pRT
Copy link
Author

p5pRT commented May 25, 2016

From @trwyant

I think that 5.26 should go out with the current fatal error for the
contexts where we previously warned, and 5.28 is free to re-purpose
the
'{' uses in these contexts.

And, I want to make the rule simple to follow. I think it's better to
simply say that unescaped literal '{' uses are deprecated, and then
add
a caveat that this is enforced only where there is ambiguity of
intent.
The current text can be improved in that regard.

The thing is, the more I think about it, the more I think the simple-to-follow argument says un-escaped literal '{' should not become fatal until _all_ cases of interest can be made fatal. Doing it in two (currently) stages means, at least, explaining to people that they are allowed (with a warning) to write /^{/, but /\A{/ is fatal -- and the same for however many other cases there are.

Or have I misunderstood?

@p5pRT
Copy link
Author

p5pRT commented Jun 10, 2016

From @khwilliamson

On 05/25/2016 12​:00 PM, Tom Wyant via RT wrote​:

I think that 5.26 should go out with the current fatal error for the
contexts where we previously warned, and 5.28 is free to re-purpose
the
'{' uses in these contexts.

And, I want to make the rule simple to follow. I think it's better to
simply say that unescaped literal '{' uses are deprecated, and then
add
a caveat that this is enforced only where there is ambiguity of
intent.
The current text can be improved in that regard.

The thing is, the more I think about it, the more I think the simple-to-follow argument says un-escaped literal '{' should not become fatal until _all_ cases of interest can be made fatal. Doing it in two (currently) stages means, at least, explaining to people that they are allowed (with a warning) to write /^{/, but /\A{/ is fatal -- and the same for however many other cases there are.

Or have I misunderstood?

I don't think you've misunderstood. But I am loathe to back off the
fatal errors, given that we've now likely got the module authors'
attention after 5 releases of threatening them with this, with quite a
few ignoring or not noticing.

It would actually be best to make the new warning fatal for regexes
compiled within those modules, so that the authors would only have to
get involved once on the entire issue.

I'm attaching a patch to look at which changes the current error's text
to indicate that it is fatal in this particular context.

It adds a new warning in the contexts where it should have warned but
didn't, and indicates that in those particular contexts, it's still
legal, but you shouldn't do it.

And I added explanatory text to perldiag explaining the situation
enough, I think, to quell any confusion. It indicates the contexts
where no warning is given, and which we'll probably never deprecate, one
of which is /^{/. This is used enough in cpan, it turns out, to want to
not deprecate it, and it makes no sense to have the { be anything else
here but a literal brace.

---
via perlbug​: queue​: perl5 status​: open
https://rt-archive.perl.org/perl5/Ticket/Display.html?id=128213

@p5pRT
Copy link
Author

p5pRT commented Jun 10, 2016

From @khwilliamson

0007-Add-missing-deprecation-message-for-unescaped-in-reg.patch
From da814ee9bcf58f82c698f30800dca313a0e0a0fb Mon Sep 17 00:00:00 2001
From: Karl Williamson <khw@cpan.org>
Date: Thu, 9 Jun 2016 21:25:46 -0600
Subject: [PATCH 7/7] Add missing deprecation message for unescaped '{' in
 regexes

The use of literal '{' without being escaped has been deprecated since
5.16, and warned out since 5.20.  In 5.24, this has been made illegal,
with a bunch of CPAN modules broken by it, in spite of the long
deprecation period.  See
https://rt.perl.org/Ticket/Display.html?id=128139

Unfortunately, I overlooked a code path, and not all instances that
should have warned did so in fact.  This was spotted by Tom Wyant in
https://rt.perl.org/Ticket/Display.html?id=128213

This commit adds that warning, and rewords the fatal one slightly, and
clarifies the whole thing in perldiag.
---
 pod/perldiag.pod | 64 +++++++++++++++++++++++++++++++++++++++++++++++---------
 regcomp.c        | 11 +++++++---
 t/re/reg_mesg.t  | 19 +++++++++++++----
 3 files changed, 77 insertions(+), 17 deletions(-)

diff --git a/pod/perldiag.pod b/pod/perldiag.pod
index dae7c26..247af33 100644
--- a/pod/perldiag.pod
+++ b/pod/perldiag.pod
@@ -6123,20 +6123,64 @@ C<undef *foo>.
 (A) You've accidentally run your script through B<csh> instead of Perl.
 Check the #! line, or manually feed your script into Perl yourself.
 
-=item Unescaped left brace in regex is illegal in regex;
+=item Unescaped left brace in regex is deprecated here, passed through in
+regex; marked by S<<-- HERE> in m/%s/
+
+(D deprecated, regexp)  See the message immediately following this one.
+
+=item Unescaped left brace in regex is illegal here in regex;
 marked by S<<-- HERE> in m/%s/
 
-(F) You used a literal C<"{"> character in a regular
-expression pattern.  You should change to use C<"\{"> or C<[{]> instead.
-If the pattern delimiters are also braces, any matching
-right brace (C<"}">) should also be escaped to avoid confusing the parser,
-for example,
+(F)
+
+The simple rule to remember if you want to match a literal C<"{">
+character (U+007B C<LEFT CURLY BRACKET>) in a regular expression pattern
+is to escape each literal instance of it in some way.  Generally easiest is
+to precede it with a backslash, like C<"\{"> or enclose it in square
+brackets (C<"[{]">).  If the pattern delimiters are also braces, any
+matching right brace (C<"}">) should also be escaped to avoid confusing
+the parser, for example,
+
+ qr{abc\{def\}ghi}
+
+Forcing literal C<"{"> characters to be escaped will enable the Perl
+language to be extended in various ways in future releases.  To avoid
+needlessly breaking existing code, the restriction is is not enforced in
+contexts where there are unlikely to ever be extensions that could
+conflict with the use there of C<"{"> as a literal.  The reason that
+there are both fatal and non-fatal warnings about this is that, because
+of an oversight, some uses of a literal C<"{"> that should have raised a
+deprecation warning starting in v5.20 did not warn until v5.26.  By
+making the already-warned uses fatal now, some of the planned extensions
+can be made to the language sooner.
+
+The contexts where no warnings or errors are raised are:
+
+=over 4
+
+=item *
 
-    qr{abc\{def\}ghi}
+as the first character in a pattern, or following C<"^"> indicating to
+anchor the match to the beginning of a line.
 
-This restriction is not enforced if the C<"{"> is the first character in
-the pattern; nor is a warning generated for this case, as there are no
-current plans to forbid it.
+=item *
+
+as the first character following a C<"|"> indicating alternation.
+
+=item *
+
+as the first character in a parenthesized grouping like
+
+ /foo({bar)/
+ /foo(:?{bar)/
+
+=item *
+
+as the first character following a quantifier
+
+ /\s*{/
+
+=back
 
 =item unexec of %s into %s failed!
 
diff --git a/regcomp.c b/regcomp.c
index 8562b8f..e431576 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -13256,7 +13256,7 @@ S_regatom(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth)
 		     * something like "\b" */
 		    if (len || (p > RExC_start && isALPHA_A(*(p -1)))) {
                         RExC_parse = p + 1;
-			vFAIL("Unescaped left brace in regex is illegal");
+			vFAIL("Unescaped left brace in regex is illegal here");
 		    }
 		    /*FALLTHROUGH*/
 		default:    /* A literal character */
@@ -13661,8 +13661,6 @@ S_regatom(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth)
 	    RExC_parse = p - 1;
             Set_Node_Cur_Length(ret, parse_start);
 	    RExC_parse = p;
-            skip_to_be_ignored_text(pRExC_state, &RExC_parse,
-                                    FALSE /* Don't force to /x */ );
 	    {
 		/* len is STRLEN which is unsigned, need to copy to signed */
 		IV iv = len;
@@ -13674,6 +13672,13 @@ S_regatom(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth)
 	break;
     } /* End of giant switch on input character */
 
+    /* Position parse to next real character */
+    skip_to_be_ignored_text(pRExC_state, &RExC_parse,
+                                            FALSE /* Don't force to /x */ );
+    if (PASS2 && *RExC_parse == '{' && OP(ret) != SBOL && ! regcurly(RExC_parse)) {
+        ckWARNregdep(RExC_parse + 1, "Unescaped left brace in regex is deprecated here, passed through");
+    }
+
     return(ret);
 }
 
diff --git a/t/re/reg_mesg.t b/t/re/reg_mesg.t
index ff20083..e3c11ba 100644
--- a/t/re/reg_mesg.t
+++ b/t/re/reg_mesg.t
@@ -268,10 +268,11 @@ my @death =
  '/(?[\ |!])/' => 'Incomplete expression within \'(?[ ])\' {#} m/(?[\ |!{#}])/',    # [perl #126180]
  '/(?[()-!])/' => 'Incomplete expression within \'(?[ ])\' {#} m/(?[()-!{#}])/',    # [perl #126204]
  '/(?[!()])/' => 'Incomplete expression within \'(?[ ])\' {#} m/(?[!(){#}])/',      # [perl #126404]
- '/\w{/' => 'Unescaped left brace in regex is illegal {#} m/\w{{#}/',
- '/\q{/' => 'Unescaped left brace in regex is illegal {#} m/\q{{#}/',
- '/:{4,a}/' => 'Unescaped left brace in regex is illegal {#} m/:{{#}4,a}/',
- '/xa{3\,4}y/' => 'Unescaped left brace in regex is illegal {#} m/xa{{#}3\,4}y/',
+ '/\w{/' => 'Unescaped left brace in regex is illegal here {#} m/\w{{#}/',
+ '/\q{/' => 'Unescaped left brace in regex is illegal here {#} m/\q{{#}/',
+ '/\A{/' => 'Unescaped left brace in regex is illegal here {#} m/\A{{#}/',
+ '/:{4,a}/' => 'Unescaped left brace in regex is illegal here {#} m/:{{#}4,a}/',
+ '/xa{3\,4}y/' => 'Unescaped left brace in regex is illegal here {#} m/xa{{#}3\,4}y/',
  '/abc/xix' => 'Only one /x regex modifier is allowed',
  '/(?xmsixp:abc)/' => 'Only one /x regex modifier is allowed {#} m/(?xmsixp{#}:abc)/',
  '/(?xmsixp)abc/' => 'Only one /x regex modifier is allowed {#} m/(?xmsixp{#})abc/',
@@ -621,6 +622,16 @@ my @experimental_regex_sets = (
 );
 
 my @deprecated = (
+ '/^{/'          => "",
+ '/foo|{/'       => "",
+ '/foo|^{/'      => "",
+ '/foo({bar)/'   => "",
+ '/foo(:?{bar)/' => "",
+ '/\s*{/'        => "",
+ '/a{3,4}{/'     => "",
+ '/.{/'         => 'Unescaped left brace in regex is deprecated here, passed through {#} m/.{{#}/',
+ '/[x]{/'       => 'Unescaped left brace in regex is deprecated here, passed through {#} m/[x]{{#}/',
+ '/\p{Latin}{/' => 'Unescaped left brace in regex is deprecated here, passed through {#} m/\p{Latin}{{#}/',
 );
 
 for my $strict ("", "use re 'strict';") {
-- 
2.5.0

@p5pRT
Copy link
Author

p5pRT commented Jun 10, 2016

From zefram@fysh.org

Karl Williamson wrote​:

+ /foo(​:?{bar)/
...
+ '/foo(​:?{bar)/' => "",

Presumably should be /foo(?​:{bar)/.

-zefram

@p5pRT
Copy link
Author

p5pRT commented Jun 17, 2016

From @khwilliamson

I have now committed the patch to blead as 8e84dec

and closing this ticket
--
Karl Williamson

@p5pRT
Copy link
Author

p5pRT commented Jun 17, 2016

@khwilliamson - Status changed from 'open' to 'pending release'

@p5pRT
Copy link
Author

p5pRT commented Mar 7, 2017

From wolf-dietrich_moeller@t-online.de

Created by wolf-dietrich_moeller@t-online.de

Seeing bug report 130497 on deprecation of "Unescaped left brace in regex",
I did some testing of my programs.

I noticed that the current Perl (5.24.1) does not always give the warning
"Unescaped left brace in regex is deprecated, passed through in regex".

The test program below only warns in line 2 (regex 1),
but not in line 3 (regex 2).

I think it should also warn in line 3. Or would this still be allowed in
forthcoming versions of Perl?

#### test program ####
print
'regex 1 = ',qr'a{b',"\n",
'regex 2 = ',qr'.{b',"\n";
#### end test program ####

#### output test program ####
Unescaped left brace in regex is deprecated, passed through in regex; marked
by
<-- HERE in m/a{ <-- HERE b/ at ...\Perl_bug\bug.pl line 2.
regex 1 = (?^​:a{b)
regex 2 = (?^​:.{b)
#### end output ####

Perl Info

Flags:
    category=core
    severity=low

Site configuration information for perl 5.24.1:

Configured by strawberry-perl at Sun Jan 15 20:30:58 2017.

Summary of my perl5 (revision 5 version 24 subversion 1) configuration:
   
  Platform:
    osname=MSWin32, osvers=6.3, archname=MSWin32-x86-multi-thread-64int
    uname='Win32 strawberry-perl 5.24.1.1 #1 Sun Jan 15 20:28:53 2017 i386'
    config_args='undef'
    hint=recommended, useposix=true, d_sigaction=undef
    useithreads=define, usemultiplicity=define
    use64bitint=define, use64bitall=undef, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='gcc', ccflags =' -s -O2 -DWIN32  -DPERL_TEXTMODE_SCRIPTS
-DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fwrapv -fno-strict-aliasing
-mms-bitfields',
    optimize='-s -O2',
    cppflags='-DWIN32'
    ccversion='', gccversion='4.9.2', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678,
doublekind=3
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12,
longdblkind=3
    ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='long
long', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='g++', ldflags ='-s -L"C:\Perl\perl\lib\CORE" -L"C:\Perl\c\lib"'
    libpth=C:\Perl\c\lib C:\Perl\c\i686-w64-mingw32\lib
C:\Perl\c\lib\gcc\i686-w64-mingw32\4.9.2
    libs=-lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32
-ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr
-lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32
    perllibs=-lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32
-ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr
-lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32
    libc=, so=dll, useshrplib=true, libperl=libperl524.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_win32.xs, dlext=xs.dll, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags='-mdll -s -L"C:\Perl\perl\lib\CORE"
-L"C:\Perl\c\lib"'



@INC for perl 5.24.1:
    C:/Perl/perl/site/lib
    C:/Perl/perl/vendor/lib
    C:/Perl/perl/lib


Environment for perl 5.24.1:
    HOME (unset)
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=C:\Documents and Settings\All Users\Application
Data\Oracle\Java\javapath;C:\Program Files\Perl\site\bin;C:\Program
Files\Perl\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Pr
ogram Files\Windows
Imaging\;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\Bin;C:\Program
Files\QuickTime
Alternative\QTSystem;C:\Perl\c\bin;C:\Perl\perl\site\bin;C:\Perl\perl\bin
    PERL_BADLANG (unset)
    SHELL (unset)

@p5pRT
Copy link
Author

p5pRT commented Mar 7, 2017

From @xenu

On Tue, 7 Mar 2017, at 17​:52, Wolf-Dietrich Moeller wrote​:

I noticed that the current Perl (5.24.1) does not always give the warning
"Unescaped left brace in regex is deprecated, passed through in regex".
(...)

It's a duplicate of
https://rt.perl.org/Public/Bug/Display.html?id=128213

@p5pRT
Copy link
Author

p5pRT commented Mar 7, 2017

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Mar 7, 2017

From @khwilliamson

On 03/07/2017 01​:31 PM, Tomasz Konojacki wrote​:

On Tue, 7 Mar 2017, at 17​:52, Wolf-Dietrich Moeller wrote​:

I noticed that the current Perl (5.24.1) does not always give the warning
"Unescaped left brace in regex is deprecated, passed through in regex".
(...)

It's a duplicate of
https://rt.perl.org/Public/Bug/Display.html?id=128213

Merged.

@p5pRT
Copy link
Author

p5pRT commented May 30, 2017

From @khwilliamson

Thank you for filing this report. You have helped make Perl better.

With the release today of Perl 5.26.0, this and 210 other issues have been
resolved.

Perl 5.26.0 may be downloaded via​:
https://metacpan.org/release/XSAWYERX/perl-5.26.0

If you find that the problem persists, feel free to reopen this ticket.

@p5pRT p5pRT closed this as completed May 30, 2017
@p5pRT
Copy link
Author

p5pRT commented May 30, 2017

@khwilliamson - Status changed from 'pending release' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant