You need to turn off buffering on STDOUT with $|=1 before the loop.
In reply to Re: split sleep question by gwadej in thread split sleep question by learn_perl_se