in reply to dereferencing question
First of all,
is equivalent toprint $array->[2]; print $hash->{a};
print $$array[2]; print $$hash{a};
So this is what we're going to compare.
I find the former much more readable, and I'm sure I'm not the only one.
The former reads from left to right. That latter requires reading the whole thing to understand what it is. And it requires knowing whether $$array[2] means ${$array[2]} or ${$array}[2]. (To add further confusion, it's the opposite of the C equivalent.) You could use ${$array}[2] to address the later problem, but now you have an even bigger mess of symbols, it's still not 100% clear to the less experienced, and you're using an extra character.
|
|---|