Exception Handling

Luis Motta Campos luismottacampos at yahoo.co.uk
Mon Jul 16 08:35:42 BST 2007

On Jul 12, 2007, at 5:55 PM, David Cantrell wrote:
> On Wed, Jul 11, 2007 at 05:01:02AM -0700, Ovid wrote:
>> And if the end-user forgets to check a return value, or checks it  
>> incorrectly (there are plenty of subtle ways this can happen),  
>> this returning false fails.  I only want to see code returning  
>> false if the failure is safe to ignore.  Otherwise, I want a  
>> proper exception.
> With that in mind, what do you think of my practice in  
> Number::Phone et
> al of returning 1 to mean "yes" (eg yes, this is a mobile number),  
> 0 to
> mean "no" (no, it's not a mobile number) and undef for "dunno"?

   Could you please provide us with an example of would trigger  
"dunno" in your code?
   Things tend to-be-or-not-to-be number phones, imho.

Luis Motta Campos (a.k.a. Monsieur Champs) is a software engineer,
Perl fanatic evangelist, and amateur {cook, photographer}

More information about the london.pm mailing list