note Don Coyote <p>There may be good reason to qualify the seemingly redundant use of the arrow dereferencer between the deepest subscripts. If not solely to understand what is happening in a different way.</p> <p> the same as</p> <code> ${${$VAR1}[0]}{41} </code> <p>The manner in which dereferencing occurs is different but the result is the same. Most feel the arrow manner is simpler on the brain, being more intuitive once you have grasped the notion of dereferencing.</p> <p>lets reduce the complexity for a moment</p> <code> my $VAR2 = [ 101, 201, 42 ]; print $VAR2->[0],' ',${$VAR2}[0]; ------- 101 101 </code> <p>we can now reach the first level reference to the array and by all accounts either syntax is fairly comprehensible.</p> <p>Lets increase the complexity back up.</p> <code> my $VAR3 = [ {'101'=>'hel', '201'=>'lo', '42'=>'world'} ]; print $VAR3->[0]->{42},' ',${${$VAR3}[0]}{42}; ------- world world </code> <p>You can already see the way of the arrow is clearer as the start of the dereference does not accumulate the scalar sigil for each depth of level of complexity. And to be fair this starts literally looking subsequently more expensive too.</p> <p>The toppler of the cake is that the arrow way also adds the optimisation of saying, hey you know what, seeing as we're already dereferencing here lets not bother making a christmas decoration out of the expression and voila! you get...</p> <code> print $VAR3->[0]{42}; --- world </code> <p>Making the array actual, you use dereffing where its needed, not between the first level subscript but between the second level subscript.</p> <code> my @VAR4 = ( {'101'=>'hel', '201'=>'lo', '42'=>'world'},' dereffed' ); print @VAR4,' ',$VAR4[0]->{42},' ',${$VAR4[0]}{42}; ------- HASH(0x3e81a4) dereffed world world </code> <p>Comparing the position of the arrow between $VAR3 and $VAR4[0], it would seem this gives us a qualifier for telling us when in a complex structure a 'reference to' or 'an actual' hash/array resides at the first level.</p> <p>The reason being data structures only hold scalars. The very reason for the requirement of referencing. As a reference to a complex structure is a scalar.</p><p>And this of course means the arrow way can safely bah humbug the merry season with all the capacity of your ram.</p> <hr> <sup>my $ah={h=>'a'};print %$ah for 0..2;</sup> 997967 997981