my @slice = @{$self}[0..$n-1];
That ought to do it. The curly brackets are being used in this case for clarity. It can also be expressed like this:
my @slice = @$self[0..$n-1];
....at least in my test cases that seems to work just fine. ;)
Dave
In reply to Re: Still slice impared
by davido
in thread Still slice impared
by John M. Dlugosz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |