Skip Menu |

This queue is for tickets about the Net-Traceroute CPAN distribution.

Report information
The Basics
Id: 94093
Status: resolved
Priority: 0/
Queue: Net-Traceroute

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

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



Subject: loading traceroute text with DNS lookups
This trivial program: iscah% more trace2.pl use strict; use warnings; use Net::Traceroute; my $trace = Net::Traceroute->new(text => <<EOF); traceroute to 8.8.8.8 (8.8.8.8), 2 hops max, 60 byte packets 1 x.y.z (1.2.3.4) 1.336 ms 1.309 ms 1.305 ms 2 a.b.c (5.6.7.8) 13.166 ms 14.209 ms 26.454 ms EOF Crashes with this error: iscah% perl trace2.pl Unmatched [ in regex; marked by <-- HERE in m/^ (!<\d+>|\?|![ <-- HERE ]?) ?/ at /home/ollisg/.perlbrew/libs/perl-5.18.2c@dev/lib/perl5/Net/Traceroute.pm line 693. OS is Debian Linux (both for where the traceroute is run and for where the Net::Traceroute parses its text). It works if I pass -n into traceroute (turning off DNS lookups).
CC: undisclosed-recipients:;
Subject: [rt.cpan.org #94093] loading traceroute text with DNS lookups
Date: Mon, 24 Mar 2014 14:34:04 -0400
To: bug-Net-Traceroute [...] rt.cpan.org
From: Daniel Hagerty <hag [...] linnaean.org>
Try the patch below if you can. Fixes your test case for me. diff --git a/Traceroute.pm b/Traceroute.pm index 26798d6..889a3ad 100644 --- a/Traceroute.pm +++ b/Traceroute.pm @@ -635,8 +635,8 @@ sub _parse ($$) { while($_) { # dns name and address; rewrite as just an address # XXX should keep dns name - s/^[-A-Za-z0-9.]+ \((\d+\.\d+\.\d+\.\d+)\)/$1/; - s/^[-A-Za-z0-9.]+ \(([0-9a-fA-F:]*:[0-9a-fA-F]*(?:\.\d+\.\d+\.\d+)?)\)/$1/; + s/^ ?[-A-Za-z0-9.]+ \((\d+\.\d+\.\d+\.\d+)\)/$1/; + s/^ ?[-A-Za-z0-9.]+ \(([0-9a-fA-F:]*:[0-9a-fA-F]*(?:\.\d+\.\d+\.\d+)?)\)/$1/; # ip address of a response s/^ ?(\d+\.\d+\.\d+\.\d+)// && do {
works! iscah% perl Makefile.PL Generating a Unix-style Makefile Writing Makefile for Net::Traceroute Writing MYMETA.yml and MYMETA.json iscah% perl -Mblib example.pl iscah%
CC: undisclosed-recipients:;
Subject: [rt.cpan.org #94093] loading traceroute text with DNS lookups
Date: Mon, 24 Mar 2014 17:18:47 -0400
To: bug-Net-Traceroute [...] rt.cpan.org
From: Daniel Hagerty <hag [...] linnaean.org>
Lovely. Should be making its way out to a cpan server near you as version 1.15.
resolving.