Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Dear Monks,
I am having trouble understanding a part of program that I am trying to tweak that I got off the web for sequence alignment.
I haven't changed anything but keep getting errors for
while (scalar(@ra) while (scalar(@rb) while (scalar(@rc) # print out the answer
It is in the context of
if (!$d->[$x][$y][0] && !$d->[$x][$y][1] && !$d->[$x][$y][2]) { for (my $u=$x; $u>0; $u--) { unshift @ra, $sa[$u-1]; } for (my $v=$y; $v>0; $v--) { unshift @rb, $sb[$v-1]; } while (scalar(@ra) while (scalar(@rb) while (scalar(@rc) # print out the ans +wer $i++; # global variable $scr = 0; # score for each alignment print "<br>Alignment: $i<br>Sa:"; foreach my $x (@ra) { print " $x"; } + print "<br>Sb:"; foreach my $y (@rb) { print " $y"; } + print "<br>Scr"; foreach my $z (@rc) { if ($z eq '.') { print " ."; } else { printf '%4d', $z; $scr += $z; } } print " = $scr<br>"; }
What does it mean? And why do I keep getting errors? #I know that scalar() is to force scalar context.#
Thanks Monks, chris
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: while (scalar()
by Happy-the-monk (Canon) on Mar 12, 2004 at 21:58 UTC | |
by cdherold (Monk) on Mar 12, 2004 at 22:02 UTC | |
by tachyon (Chancellor) on Mar 12, 2004 at 22:20 UTC | |
by Happy-the-monk (Canon) on Mar 12, 2004 at 22:16 UTC | |
by Roy Johnson (Monsignor) on Mar 12, 2004 at 22:33 UTC | |
Re: while (scalar()
by bageler (Hermit) on Mar 13, 2004 at 00:05 UTC | |
Re: while (scalar()
by TilRMan (Friar) on Mar 12, 2004 at 22:29 UTC | |
Re: while (scalar()
by esskar (Deacon) on Mar 12, 2004 at 23:05 UTC | |
Re: while (scalar()
by neniro (Priest) on Mar 12, 2004 at 22:14 UTC | |
Re: while (scalar()
by esskar (Deacon) on Mar 12, 2004 at 21:56 UTC | |
Re: while (scalar()
by Anonymous Monk on Mar 12, 2004 at 22:36 UTC |
Back to
Seekers of Perl Wisdom