The position in the file of FILEHANDLE is left unchanged. You may want to call seek before writing to the file.