in reply to Match only certain IP Addresses
In addition to the excellent advice you have already received, if you are going to be doing much manipulation of IP addresses, you will definately want to become friends with the CPAN Module Net::IP...it is a life saver!
In Section
Seekers of Perl Wisdom