in reply to making delays
As gloryhack intimates, you are suffering from buffering. Setting the special variable $| ($OUTPUT_AUTOFLUSH) to true causes Perl to flush output after write/print. See also the appropriate entry in perldoc perlvar.
In Section
Seekers of Perl Wisdom