Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Idomatic Handling of Subroutine Error

by andye (Curate)
on Sep 19, 2001 at 15:21 UTC ( [id://113291]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    unless ( $result = my_sub() ) {
       # handle error condition
    }
    
  2. or download this
    my $result;
    unless ( my_sub(\$result) ) {
       # handle error condition
    }
    
  3. or download this
    sub my_sub {
       my $r_result = shift;
       $$r_result = whatever();
       was_there_an_error() ? 0 : 1 ;
    }
    

Log In?
Username:
Password:

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

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

    No recent polls found