X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMouse%2FExporter.pm;h=0e364d1af5b34399c775791139c513d136bef76b;hb=983d58a5ea543a21c48cb04311883f1b36de1874;hp=a8a39857525c040e5dc4a8ec0384f3ce865ff6ce;hpb=54bc3ef2c2e380e9b58307a19cf5549a0b597128;p=gitmo%2FMouse.git diff --git a/lib/Mouse/Exporter.pm b/lib/Mouse/Exporter.pm index a8a3985..0e364d1 100644 --- a/lib/Mouse/Exporter.pm +++ b/lib/Mouse/Exporter.pm @@ -1,16 +1,16 @@ package Mouse::Exporter; use strict; use warnings; - use Carp (); my %SPEC; my $strict_bits; -BEGIN{ $strict_bits = strict::bits(qw(subs refs vars)); } - my $warnings_extra_bits; -BEGIN{ $warnings_extra_bits = warnings::bits(FATAL => 'recursion') } +BEGIN{ + $strict_bits = strict::bits(qw(subs refs vars)); + $warnings_extra_bits = warnings::bits(FATAL => 'recursion'); +} # it must be "require", because Mouse::Util depends on Mouse::Exporter, # which depends on Mouse::Util::import() @@ -190,7 +190,7 @@ sub do_import { require Mouse::Util::MetaRole; Mouse::Util::MetaRole::apply_metaroles( - for => $into, + for => $into, Mouse::Util::is_a_metarole($into->meta) ? (role_metaroles => { role => \@traits }) : (class_metaroles => { class => \@traits }), @@ -234,7 +234,9 @@ sub do_unimport { for my $keyword (@{ $spec->{REMOVABLES} }) { next if !exists $stash->{$keyword}; my $gv = \$stash->{$keyword}; - if(ref($gv) eq 'GLOB' && *{$gv}{CODE} == $spec->{EXPORTS}{$keyword}){ # make sure it is from us + + # remove what is from us + if(ref($gv) eq 'GLOB' && *{$gv}{CODE} == $spec->{EXPORTS}{$keyword}){ delete $stash->{$keyword}; } } @@ -256,8 +258,6 @@ sub _get_caller_package { } } -#sub _spec{ %SPEC } - 1; __END__ @@ -267,7 +267,7 @@ Mouse::Exporter - make an import() and unimport() just like Mouse.pm =head1 VERSION -This document describes Mouse version 0.82 +This document describes Mouse version 0.94 =head1 SYNOPSIS