in reply to Array - Reading frame problem

which is wrong as the "2" in "234567890" will still be in position 1.. instead of 0

No, the "2" in "234567890" is in position 0.

the lowliest monk

Replies are listed 'Best First'.
Re^2: Array - Reading frame problem
by Nadiah (Novice) on Jul 16, 2005 at 13:22 UTC

    No.. what i meant was if i apply the code $frame2 = substr($sequence, 1); to $sequence, the position of "2" will be in position "1" as i extract it using substring.
    What i meant is if there's anyway for me to extract "234567890" by using an array, instead of substr because i wan "2" to be in position 0.

      If what you mean is you want the array equivalent of substr, it's array slices. (splice looks similar to substr syntactically, but is different in that it's destructive of the source array.)
      @frame2 = @sequence[ 1 .. $#sequence ];
      The module Tie::OffsetArray could probably be used cleverly for this kind of frame-related problem.