In Perl 5, when we have a named array, for example. @a , getting elements from index $N forward just with a bit of slicing :
my @result = @a[$N..$
Is there a standard way to do the same with an anonymous array without specifying the length explicitly? That is, it can:
my @result = (0,1,2,3,4,5)[2..5];
or, more specifically, it:
my @result = (0,1,2,3,4,5)[$N..5];
converts to something that does not require a limit to the upper limit of the range? Perhaps some obscure Perl syntax? Maybe a little chop, not chop?
PS: I already wrote this as a function - I'm looking for a more independent approach.
arrays perl
thkala
source share