http://qs321.pair.com?node_id=423406


in reply to Handling non-fatal method error strings without exceptions or globals?

What's wrong with $object->get_error? This way you can have object-specific errors.

Obviously (as I confirmed in a CB session with tye,theorbtwo and others) I cannot return error strings that are logically false, but I'd like to preserve the illusion.

That's not entirely true. You can use overload to create an object that will return a string when stringified and false when boolified. And, frankly, that's what I'd do if you're not going to allow exceptions or globals, but still require an error string.

Being right, does not endow the right to be rude; politeness costs nothing.
Being unknowing, is not the same as being stupid.
Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.