Perl and Flush ...

maccatalan

Registered
Hello everybody ;)

I made a little Perl script and well ... I have a problem.

The purpose of this script if to preprocess files in a folder with some `sort` and `head` or `tail` commands and then launch a program with system() with some file-specific arguments.

The script generates a log, telling what he made as preprocess.

However the log file is only filled at the end of the script
The script creates his log file, that's ok, but he writes into it only at the end of the script. I tried to find some flush command but nothing ... :(

Can anyone help me ?

thanks a lot,
Pierre
 
anarchie said:
Did you remember to put \n when you print each line?

yes I did.

I did some research (thx google) and I found some comments like mine. It seems there is no flush-like command in perl. :( A comment suggests to use STDERR but then you're not writting to your file handler ... strange thing.

so if anyone knows how to hack this (I think it actually belongs to the hacking domain ... in the good way of course!) please, share your knowledge.

thx a lot,
Pierre.
 
Back
Top