tags:

views:

627

answers:

1

I'm trying to migrate from Moose to Mouse in the interests of speed but have encountered a showstopper error.

I'm building two objects in the same scope:

sub scope {

   my $foo = Foo->new();
   my $bar = Bar->new();

}

The BUILD method of Foo is firing but the BUILD method of Bar is not. Any ideas? Both Foo and Bar inherit from Baz which inherits from Mouse::Object.

+5  A: 

You're not really providing enough context for anybody to debug this.

Also I'm worried about your comment migrating from Moose to Mouse "in the interests of speed" without having a better. There are several packages out there that benchmark faster than either Mouse or Moose for speed. Profiling your application may show that you spend 99% of your time in metaclass compliation, accessor access, and object creation ... at which point porting to Mouse might be justified. It may turn out that you spend 99% of your time in business logic at which point porting to Mouse won't do anything for you.

Mouse is excellent, and has several specific use cases. I've used it in production when I knew I'd be running in an environment that Moose is traditionally poor at (CGI). However Mouse is not (as some people seem to claim) Moose + FAST ... Mouse is more Moose - Class::MOP (and all the hacks that have gone into normalizing Perl at the MOP level).

perigrin

related questions