develooper Front page | perl.perl5.porters | Postings from December 2010

Re: Make $obj->$method honours "&{}" overloading on $method

Thread Previous | Thread Next
Aristotle Pagaltzis
December 11, 2010 06:53
Re: Make $obj->$method honours "&{}" overloading on $method
Message ID:
* Zsbán Ambrus <> [2010-12-08 10:50]:
> >Also, if you want to define local methods and you can only use
> >method names, you have to install your methods into the
> >object's class, because methods are subs and subs are global.
> >The code reference calling mode allows you to define such
> >local methods but in a lexical way. I still think it's a big
> >win.
> You can also use the third mode to have local methods, so this
> does not alone prove that the code reference is a big win.

You can use `$foo->X::bar` instead of `$foo->$coderef` as well.
By your logic the latter is not a big win. I will argue that you
are mistaken.

Aristotle Pagaltzis // <>

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