As soon as you're done reading from
<IGUSERS> the
first time, you can't just repeat the loop later on and continue reading from it from the beginning. The
last operator simply breaks out of the loop. It doesn't affect the file pointer for
IGUSERS. Thus, if you use 'last' to break out 75% of the way through your file, the next time you come into your loop, you're starting your read from 75% through the file, not the beginning. Your best option is to read everything from
IGUSERS once into an array (or a hash for quick lookups), and do your comparisons against this variable in your big loop.