Oops, there's a typo in the for loop, it should be:
for (my $i = 0; $i <= $#a, $i++) {


On Tue, 29 Jan 2002, Edward Moon wrote:

> sleep is the function you want.
> 
> example:
> ----------------------
> #!/usr/bin/perl
> 
> my @a = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
> 
> for (my $i = 0; @a, $i++) {
>       print $a[$i], "\n";
>       sleep(5); # wait 5 seconds before continuing loop
> }
> 
> 
> On Tue, 29 Jan 2002, SuccessInMind wrote:
> 
> > Hi,
> > 
> > Can anyone point me toward their favorite timer script?
> > 
> > I want to delay each element of an array using the "foreach"
> > function with a five seconds delay between element. In other
> > words I want to introduce a five second delay between each call.
> > 
> > Is there another way beside storing "time" in a temp file and
> > comparing it with the present time to break out of the loop when
> > the time match or is greater?
> > 
> > Normand Charette
> > 
> > _______________________________________________
> > Perl-Unix-Users mailing list
> > [EMAIL PROTECTED]
> > To unsubscribe: http://listserv.ActiveState.com/mailman/listinfo/perl-unix-users
> > 
> 
> _______________________________________________
> Perl-Unix-Users mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/listinfo/perl-unix-users
> 

_______________________________________________
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/listinfo/perl-unix-users

Reply via email to