Help for this page

Select Code to Download


  1. or download this
    use Socket;
    sub add_to_ip($$)
    ...
      my( $ip, $add ) = @_;
      inet_ntoa pack( 'N', unpack('N',inet_aton $ip) + $add )
    }
    
  2. or download this
    $j = add_to_ip( $i, 1 ); # simple increment
    $j = add_to_ip( $i, -1 ); # simple decrement
    $j = add_to_ip( $i, 300 ); # addition carries over into the next-to-la
    +st quad.