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

Re: method calls on $self

Thread Previous | Thread Next
Stuart Cook
July 7, 2005 19:47
Re: method calls on $self
Message ID:
On 7/8/05, Robin Redeker <> 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 '.()'.)


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About