Re: Module Class::Stringify?

2004-12-27 Thread A. Pagaltzis
I'm a month late, but here goes: * Robert Rothenberg [EMAIL PROTECTED] [2004-11-14 15:21]: sub is_string_like { return 1, unless (defined $_[0] ref $_[0]); # We don't evaluate whether the . and .= operators are # supported, since for many applications that use strings, the

Re: Module Class::Stringify?

2004-11-15 Thread Robert Rothenberg
I'd have to double-check the overload documentation again, but I don't think overload derives cmp from string conversion, so you have to check for cmp as well. It doesn't seem to work. I think because the method isn't named '', it's just how it's set up with overload. (I have not delved into

Module Class::Stringify?

2004-11-14 Thread Robert Rothenberg
I've noticed that when authors validate string values as inputs, they often check that the value is not a reference. The problem is that it disallows objects that are overloaded to behave like strings. It's relatively easy to check that an object behaves like a string, and I have some code

Re: Module Class::Stringify?

2004-11-14 Thread Robert Rothenberg
In reading the overload manpage again, I realized that it attempts to define the comparison operators based on cmp operator if they are not there. (Or is supposed to, though some of my tests on the subroutine below show that it fails if not all of the comparisons are defined.) On 14/11/2004

Re: Module Class::Stringify?

2004-11-14 Thread Tim Bunce
On Sun, Nov 14, 2004 at 09:21:17AM -0500, Robert Rothenberg wrote: Reference: some code for testing if an argument is string-like: sub is_string_like { return 1, why the comma? unless (defined $_[0] ref $_[0]); # We don't evaluate whether the . and .= operators are #