Ken Perl wrote:
what is the difference of :: and -> in this statements?

$authInstance = Operation::Auth::getInstance($session,$u->authMethod,$u->userId)

This is a subroutine call, passing 3 arguments.


$authInstance = Operation::Auth->getInstance($session,$u->authMethod,$u->userId)

This is called a class method invocation. Perl will look for a getInstance sub in package Operation::Auth and its ancestors (via @ISA), and finally in package UNIVERSAL. If no sub is found, it will look for an AUTOLOAD sub using the same procedure and invoke it. Once a sub is found, it will be called with the string 'Operation::Auth' as the first argument, followed by the three remaining arguments.

--
Well I can't stop here all day...I'm on a cycling tour of North Cornwall!

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to