Perl: Unescaped left brace in regex is deprecated
Jump to:
Project: | Linux software |
Component: | Documentation |
Category: | bug report |
Priority: | normal |
Assigned: | Unassigned |
Status: | active |
Related pages: | #5655: French Republican Calendar :-:-: #5660: Perl |
Tags: | Perl DateTime::Calendar::FrenchRevolutionary |
Description
# perl -MDateTime::Calendar::FrenchRevolutionary -le "print DateTime::Calendar::FrenchRevolutionary->now->strftime('%c')"
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/
%([EO]?([*%a-zA-Z]))
| %{ <-- HERE (\w+)}
/ at /usr/local/lib64/perl5/5.22.2/DateTime/Calendar/FrenchRevolutionary.pm line 670, <DATA> line 1.
Pri 01 Vnd 0225 1:84:19
Comments
#1
/usr/local/lib64/perl5/5.22.2/DateTime/Calendar/FrenchRevolutionary.pm line 670:
# regex from DateTime from Date::Format - thanks Graham and Dave!
# but there is a twist: 3-char format specifiers such as '%Ey' are
# allowed. All 3-char specifiers begin with a '%E' or '%O' prefix.
# At the same time, if the user wants %Em or %Om, which do not exist, it defaults to %m
# And if the user asks for %E!,
# it defaults to E! because neither %E! nor %! exist.
$f =~ s/
%([EO]?([*%a-zA-Z]))
| %\{(\w+)}
/
$3 ? ($self->can($3) ? $self->$3() : "\%{$3}")
: ($formats{$1} ? $formats{$1}->($self)
: $formats{$2} ? $formats{$2}->($self) : $1)
/sgex;
return $f unless wantarray;
Change the incriminating line from
| %{(\w+)}
to| %\{(\w+)}
.