That's a good point
liverpole. It's useful to know that the default buffering policy is often controlled by whether the process is writing to a tty or not. You can persuade many programs to line-buffer their output by making them think they're writing to a TTY, using a module like
Expect or
IO::Pty.