Re: Infinite loop problem



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?,¤;³