Thanks, on both points. Come to think of it, you hardly ever *want* to pass an aggregate by value, so automatic aliasing ("raw" access) makes sense as a default.
On 12/8/19, Brad Gilbert <b2gi...@gmail.com> wrote: > Either use `rw` or `raw` > > Use `rw` if you need it to be mutable. > > Use `raw` if you just want to make sure you are getting the actual > variable. > > That really only applies to `$` parameters though. > > --- > > `@` and `%` parameters are `raw` already. > > sub pop-random( @_ ) { > @_.splice( (0..@_.elems).pick, 1 ) > } > > my @deck = 1..10; > say pop-random @deck; # 7 > say @deck; # [1 2 3 4 5 6 8 9 10] > > > On Sun, Dec 8, 2019 at 1:26 PM Joseph Brenner <doom...@gmail.com> wrote: > >> What's the sub signature incantation to >> pass-by-reference do you can act directly >> on the structure passed in without juggling >> an alias yourself? >> >> # deal from middle >> my $card = pop_random( @deck ); >> >