use strict; use warnings; use Net::Netmask; while (<>) { chomp; s/;/:/; my $block = new Net::Netmask($_); if (not $block) { warn "Bad CIDR specification"; next; } my @ip = $block->enumerate(); # Remove the network and gateway addresses. shift(@ip); shift(@ip); # Remove the broadcast address. pop(@ip); for my $ip (@ip) { print $ip, "\n"; } }
-><- -><- -><- -><- -><-
All things are Perfect
To every last Flaw
And bound in accord
With Eris's Law
- HBT; The Book of Advice, 1:7
In reply to Re: IP troubles
by jwest
in thread IP troubles
by toadi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |