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 behavior.
package baseclass;
use Moose;
sub BUILD { warn "in baseclass BUILD\n" }
package subclass;
use Moose;
extends 'baseclass';
# WRONG usage
after 'BUILD' => sub { warn "in bad subclass BUILD\n" };
package main;
subclass->new;
1;
Results in:
in baseclass BUILD
in baseclass BUILD
in bad subclass BUILD
$Moose::VERSION = '2.0604';
--
Bill Moseley
[email protected]