in reply to Re: Inside-out classes structure
in thread Inside-out classes structure
In A Scalar::Util::refaddr Oddity, I discussed a failure mode of pure-perl refaddr($), and ambrus pointed out another in his reply to that node.
A proposed fix:
That probably works for anything. I hedge that statement a little because some XS wizard might find a way to bless a literal constant.sub refaddr($) { my $pkg = ref($_[0]) or return; my $is_object = Scalar::Util::blessed($_[0]); bless $_[0], 'Scalar::Util::Fake' if $is_object; my $i = int($_[0]); bless $_[0], $pkg if $is_object; $i; }
After Compline,
Zaxo
|
|---|