Class-BuildMethods

 view release on metacpan or  search on metacpan

lib/Class/BuildMethods.pm  view on Meta::CPAN


use Scalar::Util qw/blessed/;

#
# This is provided next to Scalar::Util so that people can see what's going
# on.  Basically, ActiveState's build system does not provide a version of
# Scalar::Util with refaddr, so modules requiring this function cannot build.
# As a result, I'm forced to manually copy it here.
#

sub _refaddr($) {
    my $pkg = ref( $_[0] ) or return undef;
    if ( blessed( $_[0] ) ) {
        bless $_[0], 'Class::BuildMethods::Fake';
    }
    else {
        $pkg = undef;
    }
    "$_[0]" =~ /0x(\w+)/;
    my $i = do { local $^W; hex $1 };
    bless $_[0], $pkg if defined $pkg;



( run in 0.292 second using v1.01-cache-2.11-cpan-1f129e94a17 )