in reply to Re: (SPOILER) Sliced Perl
in thread Sliced Perl
(list) [-2] gives you the last but one element of the list, (list) [-1] gives you the last, (list) [0] gives the first, (list) [1] the second.$, = ", "; $\ = "\n"; print -2 .. 1; print 0 .. 4; print +(0 .. 4) [-2, -1, 0, 1]; __END__ -2, -1, 0, 1 0, 1, 2, 3, 4 3, 4, 0, 1
Abigail
|
|---|