in reply to Printing while receiving files from socket

did you considered flushing $|? see perlvar for details