in reply to writing to logfile in a loop

You need to turn on autoflush for the filehandle. You can do that with:
my $oldfh = select(FH); $| = 1; select($oldfh);
or
FH->autoflush(1);

Replies are listed 'Best First'.
Re^2: writing to logfile in a loop
by ikegami (Patriarch) on Nov 21, 2006 at 20:19 UTC
    The second method requires IO::Handle to be loaded (directly or otherwise).