Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
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? Thanksmy @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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Multilayer dereferencing question
by Anonymous Monk on Mar 13, 2018 at 13:57 UTC | |
by choroba (Cardinal) on Mar 13, 2018 at 14:04 UTC |