in reply to Matching Sequential IP Addresses

If I understand your requirements correctly, you are trying to see if a given IP address is part of a class C (or a derivative of that problem: which of a particular Class-C address is missing).

The NetAddr::IP module contains several functions that can help:

When dealing with IP addresses, this module will significantly reduce development time, improve readability, and decrease bugs. At least, it did, for me.

     "As you get older three things happen. The first is your memory goes, and I can't remember the other two... " - Sir Norman Wisdom