in reply to
Re^6: Using an array element as a loop iterator
in thread Using an array element as a loop iterator
It surely is ^^. The problem is that you can't use that construct like this:
while( $a = shift `cat file` ) (but that is a unusual way to read a file, indeed). So you do have to set @a1 first, which is the first part of my for loop. And if @a1 contains a value that is false, $a = shift @a1 will be false as well, so the loop will stop early. defined($a = shit @a1) would work, unless you want to use undef as a value. That's why I used @a1 in scalar context as the third part of the for loop.