note
monarch
In thread [id://465353] I posted some quick math subroutines you can use for converting your IP address into a number and back for arithmetic purposes without relying on any other module.
<p>Try using:<code>
sub addrtoint { return( unpack( "N", pack( "C4", split( /[.]/,$_[0]
) ) ) ) };
sub inttoaddr { return( join( ".", unpack( "C4", pack( "N", $_[0] ) )
) ) };
my $ipinc = addrtoint( '1.2.3.4' );
$ipinc++;
print( inttoaddr( $ipinc ) . "\n" );
</code></p>
467330
467330