- or download this
$hash{key}; # single dimension hash
$hash{key1}{key2}; # multiple dimension hash
- or download this
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
...
The left side of the arrow can be any expression returning a
reference, including a previous dereference.
- or download this
$array[$x]->{"foo"}->[0] = "January";
This is one of the cases we mentioned earlier in which references coul
+d spring into
...
look up {"foo"}in it. Likewise $array[$x]->{"foo"}will automatically g
+et defined
with an array reference so that we can look up [0]in it.
One more thing here.
- or download this
$array[$x]{"foo"}[0] = "January";
...
Well, okay, not entirely like C's arrays, actually.
C doesn't know how to grow its arrays on demand.
Perl does.
- or download this
$$player_dbref{player_name}{ip}{user_id};