Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks
There is any (easy way) to add a delay into a foreach loop (elaborate each element of the array after x time)? The following of course doesn't work.
#!/usr/bin/perl -w use strict; foreach (1..20) { print "a"; sleep (1);#between each element of the array there should be 1 sec +ond interval } print "\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Foreach time delay
by Corion (Patriarch) on Mar 16, 2017 at 10:49 UTC | |
by Anonymous Monk on Mar 16, 2017 at 10:55 UTC | |
| |
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 |