It may be worth having a look at my rant on the iteration through network hosts by making use of the Net::Netmask module here - Never again should your network administration scripts be non-portable! :-)
Comment on Re: Scan C Subnets for /up/down hosts and resolve names in DNS
Thanks rob_au! I wasn't aware of this module. I probably won't change anything with a small script like this. What is easier? I could change a few numbers or pack the script with the Net::Netmask module so the code is completely portable.