in reply to Odd behaviour from print statement

It really does sound like you're output is buffered. Did you select the filehandle before changing $|? If not, you're setting autoflushing for the currently selected handle (presumably STDOUT).

open(FILE, ... { my $old_selected = select(*FILE); $| = 1; select($old_selected); } print FILE ...

Replies are listed 'Best First'.
Re^2: Odd behaviour from print statement
by periapt (Hermit) on Jan 19, 2005 at 13:53 UTC
    Good idea :o) I was setting AUTOFLUSH on STDOUT vice the file handle. However, after setting it on the file, no luck. I was optimistic for a few minutes though.

    PJ
    use strict; use warnings; use diagnostics;