use Net::IP; use strict; use warnings; # ... # ... do { push @ips, $ip->ip(); } while ( ++$ip );