sub ipToInt { my $ip = shift; my $sum = 0; $sum = $sum*256 + $_ for split/\./, $ip; return $sum }