X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=blobdiff_plain;f=lib%2FMouse%2FUtil.pm;h=e86da70900972e41507d506579831d270e9556b3;hp=0e4d8652ecd184ba3dcd3e758ec9c822e729f4f4;hb=0449307510ab4425a6b340fee9bf85824eb994b1;hpb=1820fffecb0bd1da64edc16ecde534178b841d14 diff --git a/lib/Mouse/Util.pm b/lib/Mouse/Util.pm index 0e4d865..e86da70 100644 --- a/lib/Mouse/Util.pm +++ b/lib/Mouse/Util.pm @@ -1,11 +1,14 @@ package Mouse::Util; use strict; use warnings; -use base qw/Exporter/; + +use Exporter; use Carp qw(confess); -use B (); +use constant _MOUSE_VERBOSE => !!$ENV{MOUSE_VERBOSE}; + +our @ISA = qw(Exporter); our @EXPORT_OK = qw( find_meta does_role @@ -22,10 +25,11 @@ our @EXPORT_OK = qw( not_supported does meta dump + _MOUSE_VERBOSE ); our %EXPORT_TAGS = ( all => \@EXPORT_OK, - meta => [qw(does meta dump)], + meta => [qw(does meta dump _MOUSE_VERBOSE)], ); # Moose::Util compatible utilities @@ -95,6 +99,8 @@ BEGIN { my ($coderef) = @_; ref($coderef) or return; + require B; + my $cv = B::svref_2object($coderef); $cv->isa('B::CV') or return; @@ -247,7 +253,7 @@ sub apply_all_roles { if ($i + 1 < $max && ref($_[$i + 1])) { push @roles, [ $_[$i++] => $_[$i] ]; } else { - push @roles, [ $_[$i] => {} ]; + push @roles, [ $_[$i] => undef ]; } my $role_name = $roles[-1][0]; load_class($role_name);