I'm messing around with dereferencing arrays, and was curious why the following portion of this code involving the hash doesn't work:
my @array1 = (
'abc',
'def',
'ghi',
'jkl'
);
my $s1 = \@array1;
my $s2 = \$s1;
my %hash = ( 'key' => $s1 );
my $hash_s = \%hash;
print(@$$s2); # works
print(@$$hash{'key'}); # doesn't work
If I remove the @, both lines will print out an array reference. I understand how to make it work, just curious about if there's something with hashes that makes them work a little differently?
Thanks