in reply to Equation - code review

A small thing, but you do not seem to use the loop variable ($_) value in your foreach loops. Therefore it might be better to write the sequence starting from 1 and remove the subtraction, for example:
foreach (0.. (length($sequence)-1))
becomes:
foreach (1.. (length $sequence))

Replies are listed 'Best First'.
Re^2: Equation - code review
by imp (Priest) on Aug 16, 2006 at 07:49 UTC
    It's used here actually:
    my ($left,$middle,$right) = $sequence =~ m/(\w{$_})?(\w{1})?(\w*)/; ^
    The result for 0..6 would be:
    A CTGACN A C TGACN AC T GACN ACT G ACN ACTG A CN ACTGA C N ACTGAC N