in reply to IP troubles
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: IP troubles
by toadi (Chaplain) on Dec 18, 2001 at 14:41 UTC | |
by jwest (Friar) on Dec 18, 2001 at 19:27 UTC |