in reply to print problem

All good solutions but there is another way to do it...
use FileHandle; STDOUT->autoflush(1);
Should solve the problem also...