in reply to Re: Daemon problem with sleep()
in thread Daemon problem with sleep()

\n only flushes when writing to STDOUT and only when it's connected to a terminal. That's not the case here.

Autoflushing can be turned on using

use IO::Handle qw( ); LOG->autoflushing(1);

Replies are listed 'Best First'.
Re^3: Daemon problem with sleep()
by Lawliet (Curate) on Dec 17, 2008 at 19:38 UTC

    Is that the same as $|++;?

    I'm so adjective, I verb nouns!

    chomp; # nom nom nom

      $| affects the currently selected file handle (normally STDOUT).

      $|++;

      is a weird way of saying

      $|=1;

      and it's equivalent to

      select()->autoflush(1);

      But when acting on the same file handle, $|=1; and ->autoflush(1) are equivalent.