in reply to Changing the output filehandle while iterating input files.

It seems that there would be a way around checking to see if the filename in $ARGV has changed on every single line of input? Thanks,

There is. Don't use <>, use open/close and you won't have to check.