in reply to Print does not work in loop unless used with \n
Sounds like you're suffering from buffering.
Improve your skills with Modern Perl: the free book.