[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

[ID 20000114.002] Query.




HI there,

I have a query on Perl I/O I am using in my scipt and I would highly appreciate if you could
help me out with this.

Program
-------

$file="output";
open(FL,">>$file");

while (<>)
{
        print FL $_;
}

close(FL);

--------

The above program "read.pl " takes input from STDIN and writes to a file "output".

QUERY : But the write takes place only after the loop is exited and the file is closed.

Is there a way where we can flush the buffer and have it written in the while loop itself.
I looked for a flush function but could not find one.

Any suggestions ?

Thanks in advance,

Manoj





Follow-Ups from:
Ronald J Kimball <rjk@linguist.dartmouth.edu>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]