From: Yuval Kogman Date: Wed, 18 Jun 2008 09:35:49 +0000 (+0000) Subject: 5.10 produces scalar refs, not globs, for constant subs X-Git-Tag: 0_64~15 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d5be37225cd3c8428dfd2e1a5d0e2d59ce6e4472;p=gitmo%2FClass-MOP.git 5.10 produces scalar refs, not globs, for constant subs --- diff --git a/lib/Class/MOP.pm b/lib/Class/MOP.pm index 86579c6..d127aec 100644 --- a/lib/Class/MOP.pm +++ b/lib/Class/MOP.pm @@ -169,7 +169,14 @@ sub is_class_loaded { # check for any method foreach ( keys %{$$pack} ) { next if substr($_, -2, 2) eq '::'; - return 1 if defined *{${$$pack}{$_}}{CODE}; + + my $glob = ${$$pack}{$_} || next; + + if ( IS_RUNNING_ON_5_10 ) { + return 1 if ref $glob eq 'SCALAR'; + } + + return 1 if defined *{$glob}{CODE}; } # fail