in reply to Re: Dereferencing code refs with & vs. ->()
in thread Dereferencing code refs with & vs. ->()
You don't actually use -> to de-referencing, you use it access a member of a collection.
No, you use {} and [] to access a member of a collection. You use -> to dereference references. That's why it is called a "dereference operator" in perlop. (Specifically, it's called an "infix dereference operator" which helps to describe the syntax.)
Update: I imagine your confusion stems from the fact that it must be used in conjunction with {}, [], or () in order to be useful. (Hence "infix" btw.) Still, it's doing the same job as the leading dollar sign ($) in $$thingy[0].
-sauoq "My two cents aren't worth a dime.";
|
|---|