Friday, February 13, 2015

Perl Extract All Elements of an Array Except..

The first :

@a = ( 1, 2, 3, 4);
@a[1..$#a]
gives
(2, 3, 4) (all but the first)

@a[0..$#a-1]
gives
(1,2,3) (all but the last)

No comments: