in reply to Net IP

It's been easier for me to use "Net::Netmask".
use Net::Netmask; $range = undef; $range = "$ip/$maskip"; print "-- RANGE: \"$range\"\n"; $msess = undef; $msess = new Net::Netmask($range); $table = undef; $msess->storeNetblock($table); $wireip = undef; $wireip = $msess->base(); $bcastip = undef; $bcastip = $msess->broadcast(); if($debug == 1) { print "WIREIP: \"$wireip\"\n"; print "MASKIP: \"$maskip\"\n"; } # Dump all ips in range $oip = undef; foreach $oip ($msess->enumerate(0)) { print "OIP: \"$oip\"\n"; }
This has helped with finding ip's in subnets.. Especially When 1000's of subnets are used with different masks.