Skip Menu |

This queue is for tickets about the NetAddr-IP CPAN distribution.

Report information
The Basics
Id: 97455
Status: rejected
Worked: 5 min
Priority: 0/
Queue: NetAddr-IP

People
Owner: Nobody in particular
Requestors: henrylcombrinck [...] gmail.com
Cc:
AdminCc:

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



Subject: NetAddr::IP::compact() fails on long list
Date: Thu, 24 Jul 2014 10:45:06 +0200
To: bug-NetAddr-IP [...] rt.cpan.org
From: Henry Combrinck <henrylcombrinck [...] gmail.com>
Greetings, Using NetAddr::IP 4.075 on Linux, Perl v5.10.1. The attached script fails with: Can't call method "network" on an undefined value at blib/lib/NetAddr/IP.pm (autosplit into blib/lib/auto/NetAddr/IP/compactref.al) line 1194, <DATA> line 1211. But if I break the list into (4) smaller chunks, each runs successfully, and the final consolidated list runs successfully. Besides that: thanks for the module! Saved me tons of time. Regards Henry

Message body is not shown because sender requested not to inline it.

This is actually caused by a trailing space on the line mentioned of your data. I think the error message could use a little work, or perhaps it's just a failure of the simple use in this case. The push(@addresses, new..) is getting an undef on the non-CIDR line. The compact(@addresses) is bombing on the undef when trying to call undef->network. Maybe compact should check for undefs, maybe you should be checking for undefs in the return when pushing.. another alternative would be to have a new() variant that raises an exception on failure. In any case, it's fixable on the script side so I'm not sure if the developers would need to change anything. On Thu Jul 24 04:45:20 2014, henrylcombrinck@gmail.com wrote: Show quoted text
> Greetings, > > Using NetAddr::IP 4.075 on Linux, Perl v5.10.1. > > The attached script fails with: > > Can't call method "network" on an undefined value at blib/lib/NetAddr/IP.pm > (autosplit into blib/lib/auto/NetAddr/IP/compactref.al) line 1194, <DATA> > line 1211. > > But if I break the list into (4) smaller chunks, each runs successfully, > and the final consolidated list runs successfully. > > Besides that: thanks for the module! Saved me tons of time. > > Regards > Henry
Subject: Re: [rt.cpan.org #97455] NetAddr::IP::compact() fails on long list
Date: Thu, 7 Aug 2014 15:36:15 +0200
To: bug-NetAddr-IP [...] rt.cpan.org
From: Henry Combrinck <henrylcombrinck [...] gmail.com>
Damn, my bad data (trailing space in offending line). Thanks! On Thu, Aug 7, 2014 at 8:16 AM, Robert Drake via RT < bug-NetAddr-IP@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=97455 > > > This is actually caused by a trailing space on the line mentioned of your > data. I think the error message could use a little work, or perhaps it's > just a failure of the simple use in this case. > > The push(@addresses, new..) is getting an undef on the non-CIDR line. The > compact(@addresses) is bombing on the undef when trying to call > undef->network. > > Maybe compact should check for undefs, maybe you should be checking for > undefs in the return when pushing.. another alternative would be to have a > new() variant that raises an exception on failure. > > In any case, it's fixable on the script side so I'm not sure if the > developers would need to change anything. > > > > On Thu Jul 24 04:45:20 2014, henrylcombrinck@gmail.com wrote:
> > Greetings, > > > > Using NetAddr::IP 4.075 on Linux, Perl v5.10.1. > > > > The attached script fails with: > > > > Can't call method "network" on an undefined value at
> blib/lib/NetAddr/IP.pm
> > (autosplit into blib/lib/auto/NetAddr/IP/compactref.al) line 1194,
> <DATA>
> > line 1211. > > > > But if I break the list into (4) smaller chunks, each runs successfully, > > and the final consolidated list runs successfully. > > > > Besides that: thanks for the module! Saved me tons of time. > > > > Regards > > Henry
> > > >
I've closed this ticket, don't really think it's a NetAddr::IP issue On Thu Aug 07 09:36:24 2014, henrylcombrinck@gmail.com wrote: Show quoted text
> Damn, my bad data (trailing space in offending line). > > Thanks! > > > On Thu, Aug 7, 2014 at 8:16 AM, Robert Drake via RT < > bug-NetAddr-IP@rt.cpan.org> wrote: >
> > <URL: https://rt.cpan.org/Ticket/Display.html?id=97455 > > > > > This is actually caused by a trailing space on the line mentioned of your > > data. I think the error message could use a little work, or perhaps it's > > just a failure of the simple use in this case. > > > > The push(@addresses, new..) is getting an undef on the non-CIDR line. The > > compact(@addresses) is bombing on the undef when trying to call > > undef->network. > > > > Maybe compact should check for undefs, maybe you should be checking for > > undefs in the return when pushing.. another alternative would be to have a > > new() variant that raises an exception on failure. > > > > In any case, it's fixable on the script side so I'm not sure if the > > developers would need to change anything. > > > > > > > > On Thu Jul 24 04:45:20 2014, henrylcombrinck@gmail.com wrote:
> > > Greetings, > > > > > > Using NetAddr::IP 4.075 on Linux, Perl v5.10.1. > > > > > > The attached script fails with: > > > > > > Can't call method "network" on an undefined value at
> > blib/lib/NetAddr/IP.pm
> > > (autosplit into blib/lib/auto/NetAddr/IP/compactref.al) line 1194,
> > <DATA>
> > > line 1211. > > > > > > But if I break the list into (4) smaller chunks, each runs successfully, > > > and the final consolidated list runs successfully. > > > > > > Besides that: thanks for the module! Saved me tons of time. > > > > > > Regards > > > Henry
> > > > > > > >