in reply to Not understanding the arrow operator

explain what is going on with the arrow in this context, when nothing is being dereferenced
As already explained above, you are in fact dereferencing $_ which in the context of your map is a reference to a hash.

the arrow operator, which I though was just for class methods and deferencing
Here's a summary to avoid total confusion:

There are 3 cases where the array dereferences:

- $arrayref->[0];
- $hashref->{"key"};
- $coderef->("argument");

Then there are two cases for method calls:

- $object->method; # passes $object as first argument
- SomePackage->method; # passes "SomePackage" as first argument

hth

  • Comment on Re: Not understanding the arrow operator

Replies are listed 'Best First'.
Re^2: Not understanding the arrow operator
by JavaFan (Canon) on May 18, 2009 at 21:04 UTC
    There are 3 cases where the array dereferences:
    Of your three examples, only the first one has anything to do with arrays.
      Hardly any dereference between arrow and array :-)