in reply to Using optional table option in Net::Netmask

I suspect this line:
my $acl_block=new2 Net::Netmask ( +"$b");
$b is constructed as a string the line before, but according to the documentation, it should be an object.

Replies are listed 'Best First'.
Re^2: Using optional table option in Net::Netmask
by Anonymous Monk on Oct 21, 2011 at 10:40 UTC
    I've used Net::Netmask a few times. The new2 method looks ok. Looks like your trying to setup a Net::Netmask object using wild card bits instead of a subnet mask. I haven't done that before with Net::Netmask, but it looks like things went ok until line 17 of the input file. You also are using new2 which should return undef if fails. You could try adding a error check in there. Maybe the input isn't what you expected. my $acl_block = new2 Net::Netmask( $b ) or die $Net::Netmask::error to see if maybe the object isn't being created correctly and possibly why.