use Exporter;
use Carp qw(confess);
+use B ();
use constant _MOUSE_VERBOSE => !!$ENV{MOUSE_VERBOSE};
get_linear_isa
get_code_info
+ get_code_package
+
not_supported
does meta dump
my ($coderef) = @_;
ref($coderef) or return;
- require B;
-
my $cv = B::svref_2object($coderef);
$cv->isa('B::CV') or return;
return ($gv->STASH->NAME, $gv->NAME);
}
+
+ sub get_code_package{
+ my($coderef) = @_;
+
+ my $cv = B::svref_2object($coderef);
+ $cv->isa('B::CV') or return '';
+
+ my $gv = $cv->GV;
+ $gv->isa('B::GV') or return '';
+
+ return $gv->STASH->NAME;
+ }
}
# taken from Mouse::Util (0.90)
=head1 NAME
-Mouse::Util - features, with or without their dependencies
+Mouse::Util - Features, with or without their dependencies
=head1 IMPLEMENTATIONS FOR
=head2 Class::MOP
-=head2 C<< is_class_loaded(ClassName) -> Bool >>
+=head3 C<< is_class_loaded(ClassName) -> Bool >>
Returns whether C<ClassName> is actually loaded or not. It uses a heuristic which
involves checking for the existence of C<$VERSION>, C<@ISA>, and any
=head1 UTILITIES FOR MOUSE
-=over 4
-
-=item *
-
-C<not_supported>
-
-=back
+=head3 C<not_supported>
=head1 SEE ALSO