Re: Infinite loop problem
- From: cdevers@xxxxxxxxx (Chris Devers)
- Date: Tue, 13 Sep 2005 07:26:25 -0400 (EDT)
On Tue, 13 Sep 2005, Xavier Noria wrote:
> On Sep 13, 2005, at 13:00, Vineet Pande wrote:
>
> > for ( $position=0; $position < length $protein; ++$protein )
>
> Look at the right, you are incrementing $protein instead of $position.
And that's (part of) why the usual Perl idiom is to skip C style loops
like this one in favor of the simpler, clearer
foreach $position ( @protein )
which, in general, is a more direct approach to this kind of task.
--
Chris Devers
?G??Ãxb?,¤;³
- References:
- Infinite loop problem
- From: Vineet Pande
- Re: Infinite loop problem
- From: Xavier Noria
- Infinite loop problem
- Prev by Date:
Re: Infinite loop problem - Next by Date:
[Fwd: Re: Infinite loop problem] - Previous by thread:
Re: Infinite loop problem - Next by thread:
Re: Infinite loop problem - Index(es):