baxy77bax has asked for the wisdom of the Perl Monks concerning the following question:
i have a litle problem with this peace of code:
the problem is that for each argument in my array @{$maindata->1} it prints $abifiles and $sequence variable but when it comes to the last value of the array it just prints variable $abifiles but it doesn't want to return sequences from $abif->sequence() so the $sequence variable stays empty. and only for the last iteration of the foreach loop $sequence is empty. is there a way to solve (flush) this problem or go around it.use Bio::Trace::ABIF; ... my $abif = Bio::Trace::ABIF->new(); ... foreach my $abifiles (@{$maindata->[1]}){ $abif->open_abif($abifiles); print "$abifiles\n"; my $sequence = $abif->sequence(); print "$sequence\n\n"; ... and so on }
it's like he can't open the last $abifiles. i tried to change the order of the arguments in the array and still the last variable is the problem
thanx
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: foreach loop problem
by ikegami (Patriarch) on Jan 10, 2009 at 22:24 UTC | |
by baxy77bax (Deacon) on Jan 10, 2009 at 22:39 UTC |