Skip Menu |

This queue is for tickets about the SNMP-Trapinfo CPAN distribution.

Report information
The Basics
Id: 117249
Status: resolved
Priority: 0/
Queue: SNMP-Trapinfo

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

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



Subject: Unescaped left brace in regex is illegal here in regex
With perl 5.25.1 and later the test suite fails: # Failed test 'use SNMP::Trapinfo;' # at t/SNMP-Trapinfo.t line 9. # Tried to use 'SNMP::Trapinfo'. # Error: Unescaped left brace in regex is illegal here in regex; marked by <-- HERE in m/\${ <-- HERE ([\w\-\.\*:]+)}/ at /tmpfs/.cpan-build-cpansand/2016082621/SNMP-Trapinfo-1.03-0/blib/lib/SNMP/Trapinfo.pm line 67. # Compilation failed in require at t/SNMP-Trapinfo.t line 9. # BEGIN failed--compilation aborted at t/SNMP-Trapinfo.t line 9. # Failed test 'The class (or class-like) '*File::Temp::$fh' isa 'SNMP::Trapinfo'' # at t/SNMP-Trapinfo.t line 55. # The class (or class-like) '*File::Temp::$fh' isn't a 'SNMP::Trapinfo' Can't locate object method "hostname" via package "IO::File" at t/SNMP-Trapinfo.t line 57. # Looks like your test exited with 255 just after 2. t/SNMP-Trapinfo.t .. Dubious, test returned 255 (wstat 65280, 0xff00) Failed 100/100 subtests See also http://matrix.cpantesters.org/?dist=SNMP-Trapinfo%201.03 for an overview of test reports.
On Sat Aug 27 03:14:15 2016, SREZIC wrote: Show quoted text
> With perl 5.25.1 and later the test suite fails: > > # Failed test 'use SNMP::Trapinfo;' > # at t/SNMP-Trapinfo.t line 9. > # Tried to use 'SNMP::Trapinfo'. > # Error: Unescaped left brace in regex is illegal here in regex; > marked by <-- HERE in m/\${ <-- HERE ([\w\-\.\*:]+)}/ at /tmpfs/.cpan- > build-cpansand/2016082621/SNMP-Trapinfo-1.03- > 0/blib/lib/SNMP/Trapinfo.pm line 67. > # Compilation failed in require at t/SNMP-Trapinfo.t line 9. > # BEGIN failed--compilation aborted at t/SNMP-Trapinfo.t line 9. > > # Failed test 'The class (or class-like) '*File::Temp::$fh' isa > 'SNMP::Trapinfo'' > # at t/SNMP-Trapinfo.t line 55. > # The class (or class-like) '*File::Temp::$fh' isn't a > 'SNMP::Trapinfo' > Can't locate object method "hostname" via package "IO::File" at > t/SNMP-Trapinfo.t line 57. > # Looks like your test exited with 255 just after 2. > t/SNMP-Trapinfo.t .. > Dubious, test returned 255 (wstat 65280, 0xff00) > Failed 100/100 subtests > > > See also http://matrix.cpantesters.org/?dist=SNMP-Trapinfo%201.03 for > an overview of test reports.
Something like the patch attached should address the problem. Thank you very much. Jim Keenan
Subject: SNMP-Trapinfo-unescaped-left-brace.diff
Only in blib/lib/: auto Only in blib/lib/SNMP: .exists diff -u -r lib/SNMP/Trapinfo.pm blib/lib/SNMP/Trapinfo.pm --- lib/SNMP/Trapinfo.pm 2014-09-22 13:17:17.000000000 -0400 +++ blib/lib/SNMP/Trapinfo.pm 2016-12-20 13:12:31.622625497 -0500 @@ -64,7 +64,7 @@ my $string = shift; return "" if ! defined $string; my $key; - while ( ($key) = ($string =~ /\${([\w\-\.\*:]+)}/) ) { + while ( ($key) = ($string =~ /\$\{([\w\-\.\*:]+)}/) ) { my $newval; my ($action, $line) = $key =~ /^([PV])(\d+)?$/; if ($action && $line) { @@ -89,7 +89,7 @@ # Otherwise possible infinite loop # though not sure why (see tests for examples) #$string =~ s/\${$key}/$newval/; - $string =~ s/\${([\w\-\.\*:]+)}/$newval/; + $string =~ s/\$\{([\w\-\.\*:]+)}/$newval/; } return $string;
Thanks. Fixed in 1.04