in reply to split sleep question
It's easy, you should turn on autoflush on STDOUT
use strict; use warnings; use IO::Handle; autoflush STDOUT 1; my $str = "Hello!"; chomp($str); foreach ( split //, $str ) { print $_, " "; sleep 1; } print "\n";
Update: or use $|=1 as proposed by gwadej, in case of SDTOUT that perhaps better solution.
|
|---|