in reply to foreach and arrays
You should get the output "1,2,3,4,5,". This would indicate that the foreach operator work sequentially, as one would expect.@myArray = (0,0,0,0,0); $myCounter = 1; foreach $item (@myArray) { $item = $myCounter; $myCounter++; } for ( $i = 0; $i < 5; $i++ ) { print "$myArray[$i],"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(jeffa) Re: Re: foreach and arrays
by jeffa (Bishop) on Apr 19, 2001 at 03:28 UTC |