>   > Just wanted to clarify this, as I think this may be the part that
>   > overlaps with what you're doing. Under this syntax, the object would be
>   > called for you automatically, so your prototypes wouldn't have to deal
>   > with optional first arguments at all:
>   > 
>   >    print($FILE, "$stuff");  # $FILE->print($stuff)
>   >    print("$stuff");         # main::print($stuff)

>How does it know that the second version isn't:

>       $stuff->print();

[coming in on the middle of this, so context may be muddled]

But for the double quotes, it wouldn't.  But double quotes are 
going to trigger a stringification, which in most worlds produces
something that isn't overloaded.  I presume it invokes SCALAR->print
or STRING->print or something.

    $stuff->as_string->print()

Of course, the q/""/ overload for whatever class $stuff is actually
*could* return something that were itself overloaded, at which point
you'd presumably run through all that again.  But eventually this 
would have to end if you expect your program to advance. :-)

--tom

Reply via email to