There's absolutely no reason to believe that foreach has anything to do with this. I suspect the last $abifiles doesn't contains what you think it does. Perhaps there's trailing white space or a newline. Temporarily add the following inside the loop:
use Data::Dumper; local $Data::Dumper::Useqq = 1; local $Data::Dumper::Terse = 1; local $Data::Dumper::Indent = 0; print("$abifiles = ", Dumper($abifiles), "\n");
You should also change:
$abif->open_abif($abifiles);
to
$abif->open_abif($abifiles) or die("Can't open or read file \"$abifiles\". " ." Possible error: $!\n");
From looking at the source, $! is accurate if no other error messages is displayed. (It can even be accurate if another error message is displayed.)
In reply to Re: foreach loop problem
by ikegami
in thread foreach loop problem
by baxy77bax
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |