Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^3: return from subfunction

by Voronich (Hermit)
on Apr 07, 2011 at 19:26 UTC ( [id://898170]=note: print w/replies, xml ) Need Help??


in reply to Re^2: return from subfunction
in thread return from subfunction

Then what you have is pretty good. Assuming you've got a reliable branch based on error code (which you appear to), you could then use that as a dispatch so that the processing function itself had no knowledge of the errors themselves. Just go one step farther and take the error code (once you know that's what you've got) and pass it in to some error-handling function which either knows, or has access to a table of some kind that knows how to handle individual errors. That keeps your driver function sufficiently generic that it could handle anything as long as "errors are always negative numbers."
Me

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://898170]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2024-04-25 19:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found