Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

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

by legato (Monk)
on Jan 19, 2005 at 15:09 UTC ( [id://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
Domain Nodelet?
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?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2024-04-18 22:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found