Drew Kelson Drew Kelson - 6 months ago 17
Perl Question

Perl dereferencing a subroutine

I have come across code with the following syntax:

$a -> mysub($b);


And after looking into it I am still struggling to figure out what it means. Any help would be greatly appreciated, thanks!

Answer

That's a method call. $a is the invocant (a class name or an object), mysub is the method name, and $b is an argument. You should proceed to read perlootut which explains all of this.