- or download this
use 5.22.0;
use feature qw/say refaliasing/;
...
say "noref: $a[0], ref: $a->[0], list: @a";
$a = [42];
say "noref: $a[0], ref: $a->[0], list: @a";
- or download this
noref: 666, ref: 666, list: 666
noref: 666, ref: 42, list: 666
- or download this
use 5.22.0;
use feature qw/say refaliasing/;
...
(\my @sub, my $ref) = @_;
say "noref: $sub[0], ref: $ref->[0], list: @sub";
}
- or download this
noref: 666, ref: 666, list: 666 42