in reply to Ludicrously Stupid Foreach Loop Question

If you want to loop through two arrays at the same time without modifying them, you could use something like:
#!/usr/bin/perl -wT use strict; my @a = (1,2,3,4,5,6,7); # make a couple of arrays my @b = reverse @a; my $maxlen = $#a > $#b ? $#a : $#b; # find the last index of the larg +est one for my $index (0..$maxlen) { # loop through the indexes my $aval = $a[$index]; my $bval = $b[$index]; print "\$a[$index]=$aval \$b[$index]=$bval\n"; } =OUTPUT $a[0]=1 $b[0]=7 $a[1]=2 $b[1]=6 $a[2]=3 $b[2]=5 $a[3]=4 $b[3]=4 $a[4]=5 $b[4]=3 $a[5]=6 $b[5]=2 $a[6]=7 $b[6]=1

-Blake