SPUG: Advice on sub return-code policies?

Adrian Hands AEH at akc.org
Wed Oct 4 15:08:10 PDT 2006


hmmm...any chance of convincing them to:

1. make a distinction between
   a "procedural sub", that returns a "standard return code" and
   a "functional sub", that returns a value useful in an expression

  or

2. interpret the policy to say the sub needs to throw zero-or-one of a set of standardized "exceptions"

?

-----Original Message-----
From: spug-list-bounces+aeh=akc.org at pm.org on behalf of Tim Maher
Sent: Wed 10/4/2006 5:42 PM
To: spug-list at pm.org
Subject: SPUG: Advice on sub return-code policies?
 
The client I'm working with this week wants to develop a large
enterprise application in Perl using a special policy:
 every sub needs to return a standardized "error code".

They won't be writing /everything/ in the OO style, so encapsulating
the error codes within objects isn't an attractive choice.

Any ideas on how they can comply with their policy without undermining
their ability to do normal things, like chain functions together (as
in reverse sort keys)?

An "out-of-band" delivery mechanism would seem to be needed, but it
would have to be sophisticated enough to be usable with multi-
threaded apps, and no too inefficient. Are there any CPAN modules
that can help?

What advice would you offer to a client like this?

-Tim
*-------------------------------------------------------------------*
|  Tim Maher, PhD  (206) 781-UNIX   (866) DOC-PERL  (866) DOC-UNIX  |
|  tim at ( Consultix-Inc, TeachMePerl, or TeachMeUnix ) dot Com    |
*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*
| UPCOMING CLASSES; 10/9: Perl Programming  11/8: Intermediate Perl |
|  * Check out my new book: "Minimal Perl for UNIX/Linux People" *  |
|    See MinimalPerl.com for details, free chapters, and ordering   |
*-------------------------------------------------------------------*
_____________________________________________________________
Seattle Perl Users Group Mailing List  
     POST TO: spug-list at pm.org
SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list
    MEETINGS: 3rd Tuesdays
    WEB PAGE: http://seattleperl.org/


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/spug-list/attachments/20061004/970989b0/attachment.html 


More information about the spug-list mailing list