MooseX::BatmanBeforeRobin - Ordered Moose sugar
0.03
package MyClass; use MooseX::BatmanBeforeRobin; extends ...; with ...; has ...; one; # instead of 1;
This class will take over some of the exported functions from Moose and call them in "the right order":
1: extends() 2: has() 3: with() 4: override()/augment() 5: before()/after()/around()
This is done by stashing the statements away, and applying them once the "one" function is called.
This module will also export all other functions from Moose, so use Moose is not required.
use Moose
See Moose.
This function should replace 1; on the last line in your class. It will call the Moose keywords in "the right order" and afterwards make the class immutable and clear the namespace, using namespace::autoclean.
1;
This method is called on import() and sets up namespace::autoclean and Moose.
import()
Jan Henning Thorsen jhthorsen at cpan.org
jhthorsen at cpan.org
To install MooseX::BatmanBeforeRobin, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MooseX::BatmanBeforeRobin
CPAN shell
perl -MCPAN -e shell install MooseX::BatmanBeforeRobin
For more information on module installation, please visit the detailed CPAN module installation guide.