In the following perl snippet:
my $a1 = [ qw(rock pop musical) ];
my $b1 = [ qw( mystery action drama )];
my $c1 = [ qw( biography novel periodical)];
my @a2d = (
$a1,
$b1,
$c1
);
The @a2d
is an array which contain references to arrays.
My question is why the following print the same thing (musical
)?:
print ${$a2d[0]}[2],"\n";
print $a2d[0][2],"\n";
I expected the second to print ARRAY or give an error since the elements of the array are refences