develooper Front page | perl.moose | Postings from April 2018

Re: BUILD and how to create a subclass object when creating a parent

Thread Previous | Thread Next
Thomas Klausner
April 26, 2018 11:52
Re: BUILD and how to create a subclass object when creating a parent
Message ID:

On Thu, Apr 26, 2018 at 07:45:58AM -0400, Chris Prather wrote:

> > Thanks for your reply. Discussion on what containers might be, is not what I'm looking for. The question is about Moose and how it could and could be used. Formulated less open than before: is there an option for an execution order that is the inverse of Method modifiers?
> > 
> > Your final advise might be sound though, if the answer is no.
> > 
> Look at augment/inner but experience says that if you’re reaching for this you need to rethink your design because you’re over coupling something somewhere.

And while it might be possible to coerce Moose to do what you want 
automagically, I think it makes for much better / easier to 
understand code if you "just" create some methods that explictly do what 
you need. That way your future self can just read what's happening 
without having to hunt through several layers of Moose magic...


for(ref bless{},just'another'perl'hacker){s-:+-$"-g&&print$_.$/}

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