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 ?
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,
On 28/11/2011 15:03, 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 ?
Take a look at Array::Iterator, which has an