Really hard. I've been trying to fix Test::Builder's behavior with abnormal overloaded objects. This started with DateTime which can stringify and compare but not numify. This revealed that cmp_ok() isn't testing overloaded objects correctly, it always stringifies or numifies before executing the given op. Fixing that revealed all sorts of assumptions about the behavior of scalars which breaks when an overloaded object cannot stringify and/or numify. Now I have to put in careful code around every use of a scalar as a string or number. My brain hurts so yours doesn't have to.

And then there's the question of how to display an overloaded object which cannot stringify or numify? Do I just display its overload::strVal() and be done with it?

I had wanted to fix cmp_ok() in the next release but the overload bag of worms it opened up is holding up other fixes. So I think I'm going to start a branch to fix overloading and let the trunk move on.

As for good news, I might have found a way to eliminate the need for a global $SIG{__DIE__} handler.

Reply via email to