Actually, the reason why your non-working examples "do not work" is simply because that @$hr{a} is ambigious: does it mean that $hr is an array reference or does it mean that the key 'a' from the hash reference $hr contains an array reference. If the case is the latter, you really should be using syntax like so:
Data::Dumper and References quick reference are your friends. :)@{$hr->{a}} = [qw(foo bar baz)]; @{$ar->[0]} = [0 .. 9];
Update: thanks for the typo correction, ikegami.
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
In reply to Re: A better understanding of array and hash references
by jeffa
in thread A better understanding of array and hash references
by jeanluca
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |