Subject: | Unescaped left brace in regex when $spare = -1 |
In v0.004000, line 287 reads:
if ($f =~ s/^(.{0,${spare}})\n//sm) {
I have some data that happens to set $spare to -1. (I am sorry to say I have not yet been able to devise a repro - https://github.com/cxw42/git-find/tree/ddc-bug-maybe is where I am experimenting.)
When $spare == -1, Perl thinks that the {N,M} is literal braces - see brian d foy's https://www.effectiveperlprogramming.com/2018/12/perl-v5-30-lets-you-match-more-with-the-general-quantifier/ . The message is:
Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.30), passed through in regex; marked by <-- HERE in m/^(.{ <-- HERE 0,-1})\n/ at /home/cxw/perl5/lib/perl5/Data/Dumper/Compact.pm line 288.
Thank you for considering this report!
Cygwin Perl 5.26.3 x64