return map {
(ref($namespace->{$_})
? ( $_ => \&{$pkg ||= $self->name . "::$_"} )
- : ( (*{$namespace->{$_}}{CODE}) # the extra parents prevent breakage on 5.8.2
+ : ( ref \$namespace->{$_} eq 'GLOB' # don't use {CODE} unless it's really a glob to prevent stringification of stubs
+ && (*{$namespace->{$_}}{CODE}) # the extra parents prevent breakage on 5.8.2
? ( $_ => *{$namespace->{$_}}{CODE} )
: (do {
my $sym = B::svref_2object(\$namespace->{$_});
my $svt = ref $sym if $sym;
- ($sym && ($svt eq 'B::PV' || $svt eq 'B::PVIV'))
+ ($sym && ($svt eq 'B::PV' || $svt eq 'B::IV'))
? ($_ => ($pkg ||= $self->name)->can($_))
: () }) ) )
} keys %$namespace;