Also sprach Ronald Fischer:
> Given an array @x, what is the most elegant way to get a slice from
> index $n to the end of the array?
>
> My first attempt was @x[$n .. -1] failed - probably because the
> .. operator found that the rhs value was already lower than the
> lhs value and hence produced an empty range.
That's correct.
> I ended up with @x[$n .. $#x], which is not that bad, but maybe someone
> can come up with a better solution?
This is a perfectly legitimate way of doing it and I'd do it thus
myself. If you dislike the use of $#x, you could also do:
reverse +(reverse @x)[0 .. $n];
Clearly, here the cure is worse than the disease.
You might also be interested in splice(), mentioned elsewhere in this
thread. But note that this will remove the elements from the input array
so it's destructive.
Tassilo
--
use bigint;
$n=71423350343770280161397026330337371139054411854 220053437565440;
$m=-8,;;$_=$n&(0xff)<<$m,,$_>>=$m,,print+chr,,while(($ m+=

<=200);