in reply to Autoflush not possible when sleep is used?

Maybe it helps if you enable autoflushing in the print application — just kinda guessing, though...

#!/usr/bin/perl $| = 1; print STDERR " printing some text\n"; ... sleep 10;

Update: actually, on second thought, autoflushing should not be required here anyway, as you're printing to STDERR (which already does autoflush (is unbuffered) by default). IOW, I suppose the problem lies elsewhere...

Replies are listed 'Best First'.
Re^2: Autoflush not possible when sleep is used?
by moritz (Cardinal) on Feb 06, 2009 at 10:31 UTC
    since by default STDOUT is selected, setting $| = 1 shouldn't have an effect on printing to STDERR.

      yeah, you're right — I overlooked the STDERR...

Re^2: Autoflush not possible when sleep is used?
by rapide (Beadle) on Feb 06, 2009 at 16:12 UTC
    Could the problem perhaps be that I compare fileno to a descriptor which is not the one I want to find?
    In the IPC::Open3 manual it is written to either use a reference to a typeglob filehandle or scalars to filehandles.