use strict;
use warnings FATAL => 'all';
-our $VERSION = '1.001005'; # 1.1.5
+our $VERSION = '1.002002'; # 1.2.2
$VERSION = eval $VERSION;
our %INFO;
warnings->import(FATAL => 'all');
return if $INFO{$target}; # already exported into this package
# get symbol table reference
- my $stash = do { no strict 'refs'; \%{"${target}::"} };
+ my $stash = _getstash($target);
# install before/after/around subs
foreach my $type (qw(before after around)) {
*{_getglob "${target}::${type}"} = sub {
my ($me, $role) = @_;
my $info = $INFO{$role};
# grab role symbol table
- my $stash = do { no strict 'refs'; \%{"${role}::"}};
+ my $stash = _getstash($role);
# reverse so our keys become the values (captured coderefs) in case
# they got copied or re-used since
my $not_methods = { reverse %{$info->{not_methods}||{}} };
my $methods = $me->_concrete_methods_of($role);
# grab target symbol table
- my $stash = do { no strict 'refs'; \%{"${to}::"}};
+ my $stash = _getstash($to);
# determine already extant methods of target
my %has_methods;
# add does() only if they don't have one
*{_getglob "${to}::does"} = \&does_role unless $to->can('does');
- return if ($to->can('DOES') and $to->can('DOES') != UNIVERSAL->can('DOES'));
+ return if ($to->can('DOES') and $to->can('DOES') != (UNIVERSAL->can('DOES') || 0));
my $existing = $to->can('DOES') || $to->can('isa') || $FALLBACK;
my $new_sub = sub {