in reply to foreach loop problem

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.)

Replies are listed 'Best First'.
Re^2: foreach loop problem
by baxy77bax (Deacon) on Jan 10, 2009 at 22:39 UTC
    thank you, i totally overlooked this in my array:
    './F4a_0149_2008-01-25/67C092008-01-25.ab1 '
    which was easily solved by chomp($_); ++ for the replay

    thanx

    too tired !!