BUILD called twice.

2013-02-14 Thread Bill Moseley
Hi all, I had a problem that I tracked down to BUILD getting run twice. It turned out a subclass was (incorrectly) using after 'BUILD'. When that happens the BUILD in the base class runs twice. I realize it's an improper use of BUILD but just wanted to note it in case it's not an expected

Re: BUILD called twice.

2013-02-14 Thread Karen Etheridge
On Thu, Feb 14, 2013 at 12:05:02PM -0600, Dave Rolsky wrote: This is definitely a bug but it might be tricky to fix. Basically, method modifiers effectively copy the modified sub into the class that has the modifier. Moose then sees a BUILD in the subclass and baseclass and dutifully calls

Re: BUILD called twice.

2013-02-14 Thread Bill Moseley
On Thu, Feb 14, 2013 at 10:05 AM, Dave Rolsky auta...@urth.org wrote: But as you point out, what you did is just wrong anyway. The whole point of BUILD is that defining it in subclasses doesn't hide the parent's implementation. The only time you need modifiers on BUILD is when you want a

Re: BUILD called twice.

2013-02-14 Thread Jesse Luehrs
On Thu, Feb 14, 2013 at 10:58:18AM -0800, Bill Moseley wrote: On Thu, Feb 14, 2013 at 10:05 AM, Dave Rolsky auta...@urth.org wrote: But as you point out, what you did is just wrong anyway. The whole point of BUILD is that defining it in subclasses doesn't hide the parent's

Re: BUILD called twice.

2013-02-14 Thread Jesse Luehrs
On Thu, Feb 14, 2013 at 11:11:12AM -0800, Bill Moseley wrote: On Thu, Feb 14, 2013 at 11:00 AM, Jesse Luehrs d...@tozt.net wrote: In this case, you don't really want to be using BUILD at all, because running everything is basically the entire point of BUILD. Maybe your base class BUILD

Re: BUILD called twice.

2013-02-14 Thread Bill Moseley
On Thu, Feb 14, 2013 at 11:13 AM, Jesse Luehrs d...@tozt.net wrote: Baseclass-meta-remove_method( 'BUILD' ); No, that's almost certainly a bad idea. I think the best option in this case is to take this question to #catalyst or #dbix-class, and see if they can come up with a better