close $fh or croak("E: Unable to close file handle for $file: $!");