|
|
| XP is just a number | |
| PerlMonks |
Re: ip address listby aaron_baugher (Chaplain) |
| on Jan 19, 2012 at 17:12 UTC ( #948821=note: print w/ replies, xml ) | Need Help?? |
|
So you want to skip the first two addresses, then print up to the broadcast address, removing the netmask. The simplest way would be to increment the address twice before your loop. Then I'd probably use split to remove the netmask portion, though you could certainly use a regex. I tend to use split when I'm thinking "get everything before a certain character". So:
Looks like you could also use NetAddr::IP's functionality to get the address by itself, as in $ip->addr. Aaron B.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||