in reply to What is the wrong with the sleep function ?

See $| (aka OUTPUT_AUTOFLUSH) in perlvar. It is buffering the output. set $| to a true value if you don't want output to buffer.