And that undefined element should be (at least) the first in the array, because the OP only tries to print the first element (and then exits):
foreach (@file_names){ print $_; exit; }
citromatik
In reply to Re^2: Use of foreach
by citromatik
in thread Use of foreach
by Win
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |