smackdab has asked for the wisdom of the Perl Monks concerning the following question:
use NetAddr::IP; #$hosts= '172.21.3.128-172.21.3.140;10.1.1.1;192.168.0.1/8'; #$hosts= '172.21.3.128-172.21.3.140;10.1.1.1;10.0.0.0/30'; push @hosts, split ';', $hosts; for my $cidr( @hosts ) { print "$cidr\n"; my $n = NetAddr::IP->new( $cidr ); for my $ip( @{$n->hostenumref} ) { print "\t", $ip->addr, "\n"; } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: ip range for config files
by zengargoyle (Deacon) on Nov 05, 2003 at 07:55 UTC | |
Re: ip range for config files
by Roger (Parson) on Nov 05, 2003 at 05:46 UTC | |
by smackdab (Pilgrim) on Nov 05, 2003 at 05:56 UTC | |
Re: ip range for config files
by ehdonhon (Curate) on Nov 05, 2003 at 05:58 UTC | |
by smackdab (Pilgrim) on Nov 05, 2003 at 06:04 UTC | |
by ehdonhon (Curate) on Nov 05, 2003 at 06:15 UTC | |
by smackdab (Pilgrim) on Nov 05, 2003 at 07:14 UTC |