in reply to IP address generation

The very useful NetAddr::IP has some methods to walk through an IP block:
use NetAddr::IP; my $ip = NetAddr::IP->new("192.168.0.0/16"); my $bcast = $ip->broadcast; while ($ip < $bcast) { # do something with $ip $ip++; }