In perlref.pod it says:
3. The case of individual array elements arises often
enough that it gets cumbersome to use method 2. As a
form of syntactic sugar, the two lines like that above
can be written:
$arrayref->[0] = "January";
$hashref->{"KEY"} = "VALUE";
The left side of the array can be any expression
returning a reference, including a previous dereference.
I believe that "left side of the array" should read "left side of the arrow".
While this seems relatively trivial, this is _the_ place that the
rather important -> operator is defined, and its amazing how many
times I had to re-read that paragraph before I realised the simple
thing that it was trying to say!
Ta!
Martin.
3. The case of individual array elements arises often
enough that it gets cumbersome to use method 2. As a
form of syntactic sugar, the two lines like that above
can be written:
$arrayref->[0] = "January";
$hashref->{"KEY"} = "VALUE";
The left side of the array can be any expression
returning a reference, including a previous dereference.
I believe that "left side of the array" should read "left side of the arrow".
While this seems relatively trivial, this is _the_ place that the
rather important -> operator is defined, and its amazing how many
times I had to re-read that paragraph before I realised the simple
thing that it was trying to say!
Ta!
Martin.