develooper Front page | perl.perl6.language | Postings from July 2005

Re: method calls on $self

Thread Previous | Thread Next
From:
Stuart Cook
Date:
July 7, 2005 19:47
Subject:
Re: method calls on $self
Message ID:
49b3510605070719473ccba188@mail.gmail.com
On 7/8/05, Robin Redeker <elmex@x-paste.de> wrote:
> Hi,
> 
> i just wanted to ask what was about the method calling syntax on
> $self, and why does
> 
>    method ()
> 
> not work for calling a method on $self? (like in C++)

IIRC, Larry wants to be able to distinguish method calls from sub
calls, so that when you see 'foo()' inside a method, you know that
it's NOT using $?SELF.  If you want to call a method, either use an
explicit self, or use './method'.

(As a side note, putting space between the sub/method name and the
call parentheses is now disallowed.  If you must have the space, you
need to use '.()'.)


Stuart

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About