in reply to Re: Printing to a file problem
in thread Printing to a file problem

It may be that you are closing your file handle before the data is actually written out.

Closing a filehandle automatically flushes anything left in the buffer.

— Arien

Replies are listed 'Best First'.
Re: Re: Re: Printing to a file problem
by gnu@perl (Pilgrim) on Aug 23, 2002 at 14:07 UTC
    I seem to have mistated myself. What I meant to say is that the data has not yet been written to the file when he attempts to read from it and turning on autoflush would take care of that problem. You are correct about flushing on close. In the sample code here there is no close, so I must assume that he is trying to read from the file just after the write and before any close on the associated file handle.