The following gives me a compilation error Global symbol "$list" requires explicit package name at ./scratch line 19.. How can I correctly access an element in an anonymous array?
use warnings;
use strict;
use feature "say";
my @list1 = (10, 20, 30);
my @list2 = ("hello", "yellow", "mellow");
my $r1 = \@list1;
my $r2 = \@list2;
my @list = ($r1, $r2);
# Prints just fine
say join ", ", @$r1;
say join ", ", @$r2;
# This part gives compilation error
say join ", ", @$list[0];
say join ", ", @$list[1];
@{ $list[0] }?$list[0]doesn't work like@$r1does?$list[0]->@*)