in reply to Re: Iterating through all IP addresses in a CIDR
in thread Iterating through all IP addresses in a CIDR

use NetAddr::IP; my $n = NetAddr::IP->new('172.21.3.128/30' ); my $bits = $n->bits(); for my $ip( @{ $n->splitref( $bits ) } ) { print "\t", $ip->addr, "\n"; }

Replies are listed 'Best First'.