Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Idomatic Handling of Subroutine Error

by dvergin (Monsignor)
on Sep 18, 2001 at 22:28 UTC ( [id://113166]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    ($success, $err_msg) = my_sub();
    unless ($success) {
      # handle error condition using $err_msg
    }
    
  2. or download this
    unless ( my_sub() ) {
       # handle error condition
    }
    
  3. or download this
    unless ( $result = my_sub() ) {
       # handle error condition
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (4)
As of 2024-04-24 07:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found