in reply to A question about method return values and error checking

If the end result of the processing done by the subroutine is an undefined quantity, I believe that is the value it should return. poNumber() should return undef if no PO Number exists. If an undefined value would only result because of an unexpected condition, the subroutine should raise an error. An example of the latter is a subroutine that is supposed to return the name of the OS. The OS has a name, but if our code can't arrive at it, that's an error in the programming and this should be noted as such.

Dum Spiro Spero
  • Comment on Re: A question about method return values and error checking