Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Error::Simple

by hardburn (Abbot)
on Aug 20, 2003 at 14:01 UTC ( [id://285200]=note: print w/replies, xml ) Need Help??


in reply to use Error::Simple - can't be found in @INC

Bewarned about Error.pm. It has some nasty problems with closures, and I've decided to shy away from it, despite the fact that I happen to like Java-style exception handling. Personally, I go with Exception::Class, which doesn't give you the nice syntax that Error.pm does, but its good enough:

use Exception::Class ('MyException'); eval { # Pretend this says 'try' MyException->throw( error => 'I feel funny.'; }; if( UNIVERSAL::isa( $@, 'MyException' ) ) { # Pretend this says 'catc +h MyException' warn $@->error, "\n, $@->trace->as_string, "\n"; warn join ' ', $@->euid, $@->egid, $@->uid, $@->gid, $@->pid, $@ +->time; exit; }

----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer

Note: All code is untested, unless otherwise stated

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2024-04-25 15:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found