http://www.perlmonks.org?node_id=590293


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.