> Greetings, > > For you professional Perl programmers: how do you approach > exception-handling in the your world? I know there are a lot of ways Perl > gives us to do this: basic 'die', eval'ing blocks of code and the > Exception.pm module but is there a standard in the real world for handling > exceptions?
In my world, and a scary place it tis', I use a home grown object and just throw it as a return value. Subs generally then return either undef or the exception, or in the case I need a return value back I just check that return value to see if it is an instance of my exception object type. At the time, I was weary of using the die/eval model, if I had it to do over again (aka I will probably switch in the future) I would probably use a combination of the two since die/eval allows you to throw objects. perldoc Carp Might also be a useful read. If I was assigned to modify some existing Perl code, what type > of x-handling should I expect to see? > This is a trick question right? From the code I have seen/inherited I would have to answer: None. ;-) Being that this is a TMTOWTDI world I would imagine code you inherit could deal in multiple types of exception/error handling, especially depending on how many CPAN modules it might use. This is why being able to read documentation (I mean for comprehension) and learn APIs is so valueable for Perl developers.... http://danconia.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>