Method invokation on an object is done with object.method(), while method invokation on an object reference is done with object->method(). So the arrow operator also dereferences the object, and then invokes the method on that object.
Since all(?) objects in perl are references to something (often a hash), this syntax suddenly makes a lot more sense.
It is the same syntax you use when you dereference several things in perl, one of the most notable is when you invoke a reference to a sub with $code_ref->(), but also constructs like $hash_ref->{'key'}.
Since I started thinking like that, it made a lot more sense, since java has no pointers or references at all. As long as this notation type is somewhat consequent, I'm happy to use both. (Pedantic note: technically, everything in java is pointers/references, but the language hides this fact - for you nitpicks out there ;-) ).
People that are a lot better than me at this are very welcome to correct and fill in blanks. :)
Update: ariels says I am confusing references and pointers in C++ - and I am sure it is so. (Thanks for the heads up). I am not very good at it anyways... I thought it might be a reasonable explanation to why perl has the arrow notation, and not the dot as so many others. Then again, maybe not. :) Just don't try to apply any of the above to real life coding or anything. :)
Update 2: talexb sets things straight as well. Now, I remember some more... :)
In reply to Re: Noble DOT vs the Allmighty ARROW
by Dog and Pony
in thread Noble DOT vs the Allmighty ARROW
by BUU
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |