Sorry, multi-value slices require more complex syntax: @{[1,2,3]}[8,1,9]. The -> only works when you just want one value back. The @{ } form isn't actually much more verbose, but it is rather uglier. There was a patch to allow [...]->@[...] syntax (and I believe there is even a fork of Perl5 that includes such a patch) but it never got applied to official Perl 5 (I don't think I ever saw a good reason given for why it shouldn't be applied, though).
- tye
In reply to Re^4: Array/List Strangeness (why)
by tye
in thread Array/List Strangeness
by Manchego
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |