Subject: | Compilation of DateTime noisy under 5.17.0 |
When compiled under Perl 5.17.0, DateTime emits the following warning:
Unescaped left brace in regex is deprecated, passed through in regex;
marked by <-- HERE in m/
(?:
%{ <-- HERE (\w+)} # method name like
%{day_name}
|
%([%a-zA-Z]) # single character specifier like %d
|
%(\d+)N # special case for %N
)
/ at
/Users/tom/.cpan/build/DateTime-0.74-dBgtHP/blib/lib/DateTime.pm line 1066.
The perldelta for 5.17.0 says:
Literal unescaped "{" in regular expressions is now deprecated. Every
brace character should be either escaped (by a preceding backslash) or
part of a construct where it's a metacharacter. This catches likely
typos such as "/f{,3}/". It will also allow braces to be used in the
future to delimit parameters to metacharacters that currently take no
parameters.
The fix is the obvious one, and the universal diff (against the CPAN
version, which is 0.74) is attached. This appears to pass all tests
under both 5.16.0 (before deprecation) and 5.17.0 (after deprecation).
Subject: | DateTime.patch |
--- lib/DateTime.old 2012-03-22 19:51:13.000000000 -0400
+++ lib/DateTime.pm 2012-05-27 23:37:00.000000000 -0400
@@ -1048,7 +1048,7 @@
foreach my $p (@patterns) {
$p =~ s/
(?:
- %{(\w+)} # method name like %{day_name}
+ %\{(\w+)} # method name like %{day_name}
|
%([%a-zA-Z]) # single character specifier like %d
|