in reply to Re: delayed print statement?
in thread delayed print statement?

And, as has been pointed out many a time, $| affects the currently selected file handle. The turn off buffering on something else, you have to temporarily select, e.g., like so:

select((select(SOMETHING_ELSE), $| = 1)[0]);

--bwana147