in reply to Multiple loop variable in foreach statement
This should match each pair for you:
for my $key_raw (@keys_raw) { for my $key_ref (@keys_ref) { .... } }
Update:
Hm... this is just in general. In your case, both arrays are sorted, so you should use something that has a better performance. You should always remember the last used index for the inner loop. For each iteration of the outter loop, the inner loop should start from there.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Multiple loop variable in foreach statement
by tc1364 (Beadle) on Oct 12, 2004 at 16:46 UTC |