It’s legal, because a foreach loop iterates over a list, not an array. In this case, the list consists of the elements in the array @files, followed by the elements in the array @files2, followed by the elements in the array @files3. The lengths of the arrays are irrelevant.
See perlsyn#Foreach-Loops and perldata#List-value-constructors.
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
In reply to Re: Passing multiple arrays to foreach loop
by Athanasius
in thread Passing multiple arrays to foreach loop
by deshdaaz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |