sub refaddr($) { my $pkg = ref($_[0]) or return undef; bless $_[0], 'Scalar::Util::Fake'; "$_[0]" =~ /0x(\w+)/; my $i = do { local $^W; hex $1 }; bless $_[0], $pkg; $i; } #### use DynaLoader; # disable XS loading sub DynaLoader::bootstrap {1} # thanks, demerphq use Scalar::Util qw(refaddr); my $foo = {}; print $foo, $/; refaddr $foo; print $foo, $/; __END__ HASH(0x804b3f8) HASH=HASH(0x804b3f8)