$hash{key}; # single dimension hash
$hash{key1}{key2}; # multiple dimension hash
####
Subroutine calls and lookups of individual array elements arise often enough that it gets
cumbersome to use method 2. As a form of syntactic sugar, the examples for method 2 may
be written:
$arrayref->[0] = "January"; # Array element
$hashref->{"KEY"} = "VALUE"; # Hash element
$coderef->(1,2,3); # Subroutine call
The left side of the arrow can be any expression returning a
reference, including a previous dereference.
####
$array[$x]->{"foo"}->[0] = "January";
This is one of the cases we mentioned earlier in which references could spring into
existence when in an lvalue context. Before this statement, $array[$x]may have been
undefined. If so, it's automatically defined with a hash reference so that we can
look up {"foo"}in it. Likewise $array[$x]->{"foo"}will automatically get defined
with an array reference so that we can look up [0]in it.
One more thing here.
####
$array[$x]{"foo"}[0] = "January";
Which, in the degenerate case of using only ordinary arrays, gives you multidimensional
arrays just like C's:
$score[$x][$y][$z] += 42;
Well, okay, not entirely like C's arrays, actually.
C doesn't know how to grow its arrays on demand.
Perl does.
####
$$player_dbref{player_name}{ip}{user_id};