in reply to Re: Array - Reading frame problem
in thread Array - Reading frame problem

yes.. kind of.. but i was wondering if it is possible to have "individual" codes which can be reused to find $frame2 and $frame3 respectively (but there's only a need to change variable names).. and not in not in a while loop? it's because i only need to obtain another two more reading frames.


eg.
$sequence = "1234567890";
$sequence .= $frame1;
$frame 2 = "234567890";
$frame 3 = "34567890";

Replies are listed 'Best First'.
Re^3: Array - Reading frame problem
by stajich (Chaplain) on Jul 16, 2005 at 14:39 UTC
    Why are you now using strings in your example, I though the whole point was you wanted to do this on an array (although there is a perf hit, split/join can let you switch back and forth....). String operations are going to be a lot faster here than array operations if you doing this alot with long sequences...

    Isn't this just what you want?

    my @frame1 = @sequence; my @frame2 = @sequence; my @frame3 = @sequence; shift @frame2; shift @frame3; shift @frame3;