in reply to For loop suggestions

Try Range::Object::Serial - it can store ranges compactly, and provides methods to check for membership.

Use moritz's (++) idea above to generate ranges.

             Most people believe that if it ain't broke, don't fix it.
        Engineers believe that if it ain't broke, it doesn't have enough features yet.