On Tue, Aug 08, 2000 at 02:18:07PM -0000, Perl6 RFC Librarian wrote:
> Hooks will have to be put in Perl's string context so that if something
> is an object, then that object's C<STRING> method is called
> automatically. If no C<STRING> method is defined, then it should simply
> return undef (instead of printing out the ref/class info).
I'm not so sure about returning undef here. Why not fall back to the
default behaviour of Perl 5 without overload q{""} magic? As in, return the
stringified reference.
> If people want to see the ref info, they can still type:
>
> print $object;
>
> since this is not a string context. However,
As Bart Lateur (who I've been meaning to thank for pointing it out, thanks!)
pointed out, the object there -is- stringified; use overload q{""} magic is
called.
So, some method should be provided to avoid the stringification, akin to
overload::StrVal(). Perhaps overload::StrVal is sufficient.
Michael
--
Administrator www.shoebox.net
Programmer, System Administrator www.gallanttech.com
--