On Sun, 25 Feb 2018 23:50:45 -0800, sprout wrote: > Now, for perl 5.8.1 to 5.10.0, we have (1) an overload::StrVal that > loads Scalar::Util at run time, and (2) an overload::Overloaded which > for Carp is unusable, since it calls ->can. > > Either we go ahead and load Scalar::Util when loading Carp--which I > don’t like, but I can be persuaded--, or we avoid overload::StrVal and > do it the hard way, writing a pure-Perl StrVal. > > For Perl 5.8.0 (yes, I think we should support 5.8.0 still), > overload::StrVal has the worst implementation yet. It unconditionally > blesses any ref passed to it, which may well cause real problems. Use > of overload::StrVal isn’t all that common, compared to Carp. Carp > will make it common and start blessing people’s references left and > right when generating a stack trace. Avoid this old StrVal at all > costs! To make things worse, the old pure-Perl Scalar::Util::refaddr also unconditionally blesses references. It looks almost the same as the old StrVal, so it was probably copied, pasted and tweaked. That means if we were to use overload::StrVal from 5.8.1 to 5.10.0 (which uses refaddr) we would have to make sure the XS Scalar::Util was loaded. That’s getting too complicated. > It looks as though the simplest approach to all this is: > - For 5.10.1+, use overloading.pm. > - For 5.10.0-, give Carp its own pure-Perl StrVal. All the more necessary, considering what I just discovered about refaddr. -- Father Chrysostomos --- via perlbug: queue: perl5 status: resolved https://rt.perl.org/Ticket/Display.html?id=132902Thread Previous | Thread Next