X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=blobdiff_plain;f=lib%2FMouse%2FExporter.pm;h=4635654d3be48da86559c1aacadb058691054c01;hp=2ee752bc55e3bbbe9290d97e822b9fcd9135b9d2;hb=c2168931940aa681120ba25c60658fe33c42cc1d;hpb=1194aedef7b9a3f8c4a36fd7060c27b1a2907b87 diff --git a/lib/Mouse/Exporter.pm b/lib/Mouse/Exporter.pm index 2ee752b..4635654 100644 --- a/lib/Mouse/Exporter.pm +++ b/lib/Mouse/Exporter.pm @@ -6,14 +6,15 @@ use Carp qw(confess); my %SPEC; -use constant _strict_bits => strict::bits(qw(subs refs vars)); +my $strict_bits; +BEGIN{ $strict_bits = strict::bits(qw(subs refs vars)); } # 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; + $^H |= $strict_bits; # strict->import; ${^WARNING_BITS} |= $warnings::Bits{all}; # warnings->import; return; } @@ -32,10 +33,15 @@ 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); }, ); @@ -162,7 +168,7 @@ sub do_import { } } - $^H |= _strict_bits; # strict->import; + $^H |= $strict_bits; # strict->import; ${^WARNING_BITS} |= $warnings::Bits{all}; # warnings->import; if($spec->{INIT_META}){ @@ -258,7 +264,7 @@ Mouse::Exporter - make an import() and unimport() just like Mouse.pm =head1 VERSION -This document describes Mouse version 0.50_03 +This document describes Mouse version 0.50_04 =head1 SYNOPSIS