Inspecting and printing @array, @F and the raw-line all show that the final entry is a blank line. The split handles all lines containing content as intended, and these errors only occur when it reaches the end of any given input file - but skipping empty lines still does not appear to work oddly.