> -----Message d'origine----- > De�: Jonathan Paton [mailto:[EMAIL PROTECTED] > Envoy�: samedi 4 d�cembre 2004 20:08 > ��: Nilay Puri, Noida; [EMAIL PROTECTED] > Objet�: Re: Is try-catch a better method for handling errors ? > > Dear Nilay, > > I strongly recommend using exceptions (what you call "try-catch"), since > you need to do something more complicated upon failure. > > You can implement exceptions using eval, die and checking the return > value of eval. This is a rather ugly way to implement exceptions, but > commonly used. A better way is to use the Error module. > > perldoc Error > > Sidenote: Consider transactions if your DB supports them, depending on > what you are doing. > > Jonathan Paton
I don't like the Error module, it's to verbose ... (remind me the eternal java debat on: checked and unchecked exceptions). Though this is just my humble opinion. I'm using eval and never heard around me that it's ugly :) Jos�. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>
