You know how Moose automatically turns on strict
and warnings
during import? I want to extend that behavior by turning on autodie
and
My approach solves the problem backwards.
Why not use ToolSet to create a group of use
statements that includes Moose
, along with your additional pragmas?
The code should look something like:
# MagicMoose.pm
package MagicMoose;
use base 'ToolSet';
ToolSet->use_pragma( qw/feature :5.10/ ); # perl 5.10
ToolSet->use_pragma( qw/autodie/ );
# define exports from other modules
ToolSet->export(
'Moose' => undef, # get the defaults
);
1; # modules must return true
I haven't tested this. Frankly, I just found ToolSet
a few days ago, and haven't had a chance to try it out yet. FWIW, the reviews are positive.