summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/MooseX/Extension.pm11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/MooseX/Extension.pm b/lib/MooseX/Extension.pm
index ccfc54c..de49c2a 100644
--- a/lib/MooseX/Extension.pm
+++ b/lib/MooseX/Extension.pm
@@ -2,12 +2,19 @@ package MooseX::Extension;
use Moose ();
use Moose::Exporter;
use Moose::Util::MetaRole;
+use Data::OptList qw(mkopt_hash);
-my ($import, $unimport);
+my ($unimport, $args);
sub import {
my $caller = caller;
- ($import, $unimport) = Moose::Exporter->build_import_methods;
+ shift;
+ $args = mkopt_hash(\@_);
+ my @also = grep { !defined $args->{$_} && delete $args->{$_} } keys %$args;
+ my $import;
+ ($import, $unimport) = Moose::Exporter->build_import_methods(
+ also => \@also,
+ );
goto $import;
}