As a first step to introducing modern Perl to the Topsy code base, I've created a Local::Std module that provides all of the basic features I think no Perl program should be without. It's all the same idea of what ToolSet does, but with a bit more control.
Of course Moose support is necessary when writing OO code. There is much of Moose that annoys me, but using it is definitely better than not using it. Then again, for many cases, Mouse is adequate. So we use Any::Moose to allow loading either.
Also standard for classes are my own MooseX::Locked (when using real Moose) plus MooseX::StrictConstructor (which ought to be the Moose default, really).
I also provide easy access to MooseX::ParameterizedRole. When you need a PR, you really need it.
The interface to all this is very simple, an absolutely vital design point:
- use Local::Std - only language features (described in a future post)
- use Local::Class - Std + Any::Moose + namespace clean
- use Local::Role - Std + Any::Moose('Role') + namespace clean
- use Local::RoleParam - Std + Moose + MooseX::ParameterizedRole + namespace clean
Next post: The language features in Local::Std. Lots of goodies.
PS: I have ported autoclean to Mouse. I hope the patches are accepted upstream. Meanwhile, when using Mouse, we fall back to namespace::clean. This seems ... less than ideal.