Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Override new in Moose for flyweight objects

by Aaronrp (Scribe)
on Apr 07, 2020 at 19:45 UTC ( [id://11115190]=note: print w/replies, xml ) Need Help??


in reply to Override new in Moose for flyweight objects

Ah, well turns out I'm calling BUILDARGS twice, since it's called in TestNew::new as well as in Moose::Object::new. I'm not sure how to get around that at this point.
  • Comment on Re: Override new in Moose for flyweight objects

Replies are listed 'Best First'.
Re^2: Override new in Moose for flyweight objects
by Aaronrp (Scribe) on Apr 09, 2020 at 01:11 UTC

    Well I'm feeling a bit better about myself since it turns out MooseX::Role::Flyweight also calls BUILDARGS twice, it's just careful to pass the original arguments to the new in Moose::Object, rather than the already-processed ones. You just hope the BUILDARGS it's calling doesn't do anything that is a problem if it's done more than once.

    I couldn't seem to figure out how to override _generate_fallback_constructor (from Class::MOP::Class) on a metaclass instance (I tried making a role with a method by that name and applying it, but it didn't seem to work). My head starts to spin whenever I think too much about applying roles to instances of metaclasses.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11115190]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2024-04-20 05:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found