in reply to Module to Check Constructors?

There are various OO modules that try to provide some of the convenience that Moose provides, while reducing the cost. For example Moo, Mo and M. Maybe one of them does what you want. Or search for terms like object and class.

That said your use of strict validation and construction in the same method makes it very hard to subclass from your classes. If that's not what you want, you might consider splitting up the two, and maybe provide an initialization methods that subclasses can call on an already blessed hash.

Replies are listed 'Best First'.
Re^2: Module to Check Constructors?
by tobyink (Canon) on Mar 09, 2012 at 17:32 UTC

    M is just a joke module. Mouse (and its friend Any::Moose) might be of more practical use.

      M is just a joke module.
      Moo and Mo are not. What is Perl without jokes, anyway?