in reply to Foreach time delay
The above works, but you are Suffering from Buffering.
Set autoflush if you want output to STDOUT to appear unbuffered:
$| = 1;
Alternatively, print newlines:
foreach (1..20) { print "a\n"; sleep (1);#between each element of the array there should be 1 sec +ond interval }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Foreach time delay
by Anonymous Monk on Mar 16, 2017 at 10:55 UTC | |
| |
|
Re^2: Foreach time delay
by Anonymous Monk on Mar 16, 2017 at 15:14 UTC | |
by Anonymous Monk on Mar 16, 2017 at 15:41 UTC | |
by Anonymous Monk on Mar 16, 2017 at 17:39 UTC |