http://www.perlmonks.org?node_id=948841


in reply to ip address list

By the way, you might find the hostenum method useful.

my $net = NetAddr::IP->new('10.2.9.0/29'); my $seen_gateway; for my $ip ($net->hostenum) { next if !$gateway++; print $ip->addr, "\n"; }

Update: Oops, you wanted to skip the first address.

my $net = NetAddr::IP->new('10.2.9.0/29'); my @hosts = $net->hostenum; for my $ip (@hosts[1..$#hosts]) { print $ip->addr, "\n"; }