in reply to real time output
Have you tried setting $| (auto flush) true? Perl flushes output after every print then rather than buffering until it has a nice pile of stuff to output.