X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMouse%2FExporter.pm;h=b644c5fd11f5a1607928aa44904df03f48e8bb32;hb=7537134acef99fb05d05136200032945259d7073;hp=19ed858a3417a634ca516d7028184d488ec8308e;hpb=98a8fd12ede46b22edc10d229680d9d2e8deeade;p=gitmo%2FMouse.git diff --git a/lib/Mouse/Exporter.pm b/lib/Mouse/Exporter.pm index 19ed858..b644c5f 100644 --- a/lib/Mouse/Exporter.pm +++ b/lib/Mouse/Exporter.pm @@ -9,13 +9,19 @@ 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') } + # it must be "require", because Mouse::Util depends on Mouse::Exporter, # which depends on Mouse::Util::import() require Mouse::Util; sub import{ - $^H |= $strict_bits; # strict->import; - ${^WARNING_BITS} |= $warnings::Bits{all}; # warnings->import; + # strict->import; + $^H |= $strict_bits; + # warnings->import('all', FATAL => 'recursion'); + ${^WARNING_BITS} |= $warnings::Bits{all}; + ${^WARNING_BITS} |= $warnings_extra_bits; return; } @@ -33,15 +39,10 @@ sub setup_import_methods{ export_to_level => sub { my($package, $level, undef, @args) = @_; # the third argument is redundant - - Carp::carp("$package->export_to_level has been deprecated." - ." Use $package->import({ into_level => LEVEL }) instead"); $package->import({ into_level => $level + 1 }, @args); }, export => sub { my($package, $into, @args) = @_; - Carp::carp("$package->export has been deprecated." - ." Use $package->import({ into => PACKAGE }) instead"); $package->import({ into => $into }, @args); }, ); @@ -49,7 +50,7 @@ sub setup_import_methods{ } sub build_import_methods{ - my($class, %args) = @_; + my($self, %args) = @_; my $exporting_package = $args{exporting_package} ||= caller(); @@ -168,8 +169,10 @@ sub do_import { } } - $^H |= $strict_bits; # strict->import; - ${^WARNING_BITS} |= $warnings::Bits{all}; # warnings->import; + $^H |= $strict_bits; # strict->import; + # warnings->import('all', FATAL => 'recursion'); + ${^WARNING_BITS} |= $warnings::Bits{all}; + ${^WARNING_BITS} |= $warnings_extra_bits; if($spec->{INIT_META}){ my $meta; @@ -264,7 +267,7 @@ Mouse::Exporter - make an import() and unimport() just like Mouse.pm =head1 VERSION -This document describes Mouse version 0.50_05 +This document describes Mouse version 0.64 =head1 SYNOPSIS