Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
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 rifling through the Monastery: (10)
As of 2015-07-29 03:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (260 votes), past polls