You can't take a ref to an array slice, but you can get an array of refs to a slice of an array. The difference is subtle, but it has many of the same benefits.
my @a = (0..9); my @b = ( \( @a ) )[0..4]; ${ $b[3] } = 'It changed'; print "@a"; 0 1 2 It changed 4 5 6 7 8 9
In reply to Re: reference to an array slice?
by BrowserUk
in thread reference to an array slice?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |