in reply to Looping thru an array with differing intervals

FYI,

This does not do what you think it does:

open IN_FILE, $in_file || die "Couldn't open $in_file: $!\n";

|| has a very high precedence. You probably want to use the lower-precedence 'or' operator here instead. Otherwise, your code above gets evaluated more like this:

open(IN_FILE, ($in_file || die "Couldn't open $in_file: $!\n"));

Obviously not what you want.