in reply to Re: Slicing an array variable with a -1 or any negative number doesn't work
in thread Slicing an array variable with a -1 or any negative number doesn't work

FWIW, slicing in Python works the way the OP seems to expect. One of the few times where Perl makes more sense than Python IMO.
  • Comment on Re^2: Slicing an array variable with a -1 or any negative number doesn't work

Replies are listed 'Best First'.
Re^3: Slicing an array variable with a -1 or any negative number doesn't work
by ikegami (Patriarch) on Nov 29, 2017 at 18:31 UTC

    Then you'll be disappointed to learn about substr($s, 0, -1) and slice(@a, 0, -1)

      You mean splice(@a, 0, -1)? What makes you think I don't know about it?