in reply to Moose: return null object
However, you might have a problem that it's not actually an object. Method calls and other attribute checking would all barf.
So you might actually create a null object, by blessing it into some class and make sure that, when testing in boolean context, it returns false. I imagine you can use overload (with "bool") for that...
In addition, you could have an AUTOLOAD sub which just does nothing, to avoid having to test if calling any method would croak.
|
|---|