Drew Kelson Drew Kelson - 2 years ago 89
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 Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download