X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMouse%2FExporter.pm;h=971be8aad4573bfa2d26c204ad87106fc69e3b7c;hb=2efecf0c95cc665cfeb69e36107a1c1320ff52cf;hp=881a6aa72d16992c37cd5aa7433da0caaeeca55f;hpb=d794b33466a638e2b8d1dbc1b184773380c14b3c;p=gitmo%2FMouse.git diff --git a/lib/Mouse/Exporter.pm b/lib/Mouse/Exporter.pm index 881a6aa..971be8a 100644 --- a/lib/Mouse/Exporter.pm +++ b/lib/Mouse/Exporter.pm @@ -6,14 +6,14 @@ use Carp qw(confess); my %SPEC; -my $strict_bits = strict::bits(qw(subs refs vars)); +use constant _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; } @@ -113,7 +113,7 @@ sub setup_import_methods{ # for backward compatibility *{$exporting_package . '::export_to_level'} = sub{ - my($package, $level, @args) = @_; + my($package, $level, undef, @args) = @_; # the third argument is redundant do_import($package, { into_level => $level + 1 }, @args); }; *{$exporting_package . '::export'} = sub{ @@ -150,7 +150,7 @@ sub do_import { } } - $^H |= $strict_bits; # strict->import; + $^H |= _strict_bits; # strict->import; ${^WARNING_BITS} = $warnings::Bits{all}; # warnings->import; if($into eq 'main' && !$spec->{_export_to_main}){ @@ -223,6 +223,8 @@ sub _get_caller_package { } } +#sub _spec{ %SPEC } + 1; __END__ @@ -278,3 +280,4 @@ but you can easily get the metaclass by C<< caller->meta >> as L show L =cut +