Skip Menu |

This queue is for tickets about the Geo-PostalAddress CPAN distribution.

Report information
The Basics
Id: 114329
Status: open
Priority: 0/
Queue: Geo-PostalAddress

People
Owner: pauamma [...] cpan.org
Requestors: jim.avera [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: [PATCH] regex warning at PostalAddress.pm line 238
Date: Wed, 11 May 2016 09:45:52 -0700
To: bug-Geo-PostalAddress [...] rt.cpan.org
From: Jim Avera <jim.avera [...] gmail.com>
Hello, perl 5.22 emits the following warning when using Geo::PostalAddress : Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\${ <-- HERE ([^{}]+)}/ at /home/jima/perl5/lib/perl5/Geo/PostalAddress.pm line 238. I think this is because the { could be confused with a {min,max} regex quantifier in $line =~ s/\${([^{}]+)}/$display->{$1}/eg; Here is a patch which I think fixes the problem. I have not run your regression tests, though! Thanks, -Jim Avera --- Geo/PostalAddress.pm.OLD 2016-05-11 16:39:34.043883952 +0000 +++ Geo/PostalAddress.pm 2016-05-11 16:39:55.771855476 +0000 @@ -235,7 +235,7 @@ my $line = $segment->{StoredTemplate}; my $rownum = $segment->{StoredRownum}; - $line =~ s/\${([^{}]+)}/$display->{$1}/eg; + $line =~ s/\$\{([^{}]+)\}/$display->{$1}/eg; if ($rownum < 0) { $storage_bottom[1 - $rownum] = $line;
On 2016-05-11 12:46:03, jim.avera@gmail.com wrote: Show quoted text
> Hello, > > perl 5.22 emits the following warning when using Geo::PostalAddress : > > Unescaped left brace in regex is deprecated, passed through in > regex; marked by <-- HERE in m/\${ <-- HERE ([^{}]+)}/ at > /home/jima/perl5/lib/perl5/Geo/PostalAddress.pm line 238.
And with perl 5.25.x this is a fatal error.
On Wed May 11 12:46:03 2016, jim.avera@gmail.com wrote: Show quoted text
> Hello, > > perl 5.22 emits the following warning when using Geo::PostalAddress : > > Unescaped left brace in regex is deprecated, passed through in > regex; marked by <-- HERE in m/\${ <-- HERE ([^{}]+)}/ at > /home/jima/perl5/lib/perl5/Geo/PostalAddress.pm line 238. > > I think this is because the { could be confused with a {min,max} regex > quantifier in > $line =~ s/\${([^{}]+)}/$display->{$1}/eg;
Wow, that module is old. I need to check it against changes in postal standardsduring the past 10+ years, and I'll look at your patch at the same time. This could take me some time, though. Thanks for the patch!
From: jim.avera [...] gmail.com
On Sun May 15 17:41:48 2016, PAUAMMA wrote: Show quoted text
> Wow, that module is old. I need to check it against changes in postal > standardsduring the past 10+ years, and I'll look at your patch at the > same time. This could take me some time, though. Thanks for the patch!
This is now a FATAL ERROR (with Perl v5.26.0). Would you please apply the patch (or manually add a \ before the literal { in the regex at line 238)? Thanks urgently... -Jim