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

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

by demerphq (Chancellor)
on Jan 19, 2005 at 17:58 UTC ( #423455=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use Scalar::Util qw(dualvar);
    my %Error=(220=>"Cannot connect to service");
    ...
    }
    my $x;
    $x=mysub() or die $Error{$x};
    
  2. or download this
    use Scalar::Util qw(dualvar);
    my %Error=(220=>"Cannot connect to service");
    ...
    }
    
    mysub() or die sprintf "%d %s",$@,$Error{0+$@};
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (12)
As of 2014-07-12 07:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (238 votes), past polls