Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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?
[Discipulus]: good morning Corion
[haukex]: Good morning!

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (9)
As of 2017-02-28 08:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (398 votes). Check out past polls.