Class::MOP::Method::Constructor - Method Meta Object for constructors use Class::MOP::Method::Constructor; my $constructor = Class::MOP::Method::Constructor->new( metaclass => $metaclass, options => { debug => 1, # this is all for now }, ); # calling the constructor ... $constructor->body->execute($metaclass->name, %params); This is a subclass of "Class::MOP::Method" which deals with class constructors. This is used when making a class immutable to generate an optimized constructor. This returns the options HASH which is passed into "new". This returns the metaclass which is passed into "new". This returns the list of attributes which are associated with the metaclass which is passed into "new". This returns the meta instance which is associated with the metaclass which is passed into "new". This returns a boolean, but since constructors are very rarely not inlined, this always returns true for now. This method always returns true in this class. It exists so that subclasses (like in Moose) can override and do some sort of checking to determine whether or not inlining the constructor is safe. This creates the code reference for the constructor itself.

Method Generators
Stevan Little <stevan@iinteractive.com> Copyright 2006-2008 by Infinity Interactive, Inc. <http://www.iinteractive.com> This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.