On 11-11-28 10:03 AM, Ramprasad Prasad wrote:
I have an array of scalars.

I want to run a loop like this




my @workers = qw ( a b c );
my $MAXCHILD = 20;

foreach my $i( 0 .. $MAXCHILD){
    run_job($i,$workers[$i++]);
}



Can I do this ?


for my $i ( 0 .. $MAXCHILD ){
    run_job( $i, $workers[ $i % @workers ] );
}


--
Just my 0.00000002 million dollars worth,
  Shawn

Programming is as much about organization and communication
as it is about coding.

Never give up your dreams.  Give up your goals, plans,
strategy, tactics, and anything that's not working but never
give up your dreams.

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to