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

Handling non-fatal method error strings without exceptions or globals?

by legato (Monk)
on Jan 19, 2005 at 15:09 UTC ( #423402=perlquestion: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    unless ( $object->method('param') ) {
        ## somehow get $errstr
    ...
    }
    
    ## %erract contains such things as ('220' => sub { die $_ });
    
  2. or download this
    unless ( $object->method('param') ) {
        my ($errcode) = split ' ', $_;
        &$erract{$errcode}($_);
    }
    
  3. or download this
    eval { $object->method('param') }; if ($@) {
        my ($errcode) = split ' ', $@;
        &$erract{$errcode}($@);
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://423402]
Approved by Corion
Front-paged by holli
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2014-04-20 04:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (485 votes), past polls