So you've switched to Moose a long time ago and you're quite happy with it, but you slowly notice that there are, well, things you wish it did differently. Fortunately, there's the
MooseX:: namespace and now you have boilerplate you type at the beginning of every module.
use Moose; use MooseX::StrictConstructor; use MooseX::HasDefaults::RO; use My::Moose::Types;
The above incantation says "die if there are unknown arguments to new(), and attributes should be read-only by default, and throw in my custom-defined Moose types as well".
But boilerplate is bad. In my quest to remove boilerplate, I've produced Test::Most and other modules, but in this case, there's not much to release because many people's Moose preferences will be different. Still, it would be much nicer to write
use My::Moose; rather than continually repeating the lines above, so here's how to do that.