You are
Suffering from Buffering. You can, as
zentara said, make your filehandles unbuffered. That is a good first step. If it works, then great. However there is a real possibility, and this could well be OS dependent, that ProFit itself is detecting whether it is on a terminal, and buffers output if it is not. In that case you will need to provide it with a terminal. Which
Expect can allow you to do.