DCPM: Errors and Exceptions included

Simon Waters Simon at wretched.demon.co.uk
Tue Nov 11 15:26:59 CST 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Okay,

getting into Perl a bit further this week, my brain was reasonably
together today even if it did take me a minute or two to dereference the
return values from selectall_arrayref method in DBI.

Are there any guidelines or good articles on error handling in Perl?

The current program I'm working on it using "eval"/"die"/"$@" very much
in the style of exception handling one might do in other languages (e.g.
Java try/catch).

I'm reasonably happy with it for this small program, although I get the
feeling it was only ever intended for very rare error conditions. Things
like if I pass the error message up, I'm going to want to trim the line
number, as the end user doesn't really care at what line things failed,
give me this impression.

Google was remarkably unhelpful, throwing me a really interesting
discussion on Perl coding standards.... or did I miss a manual page?

 Simon
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE/sVQhGFXfHI9FVgYRAjKDAKDFQa6N5gOwdU/X4+L0dQCIoCrvWACfYE/y
3kK3bklEZlw9CH/QrYV0kck=
=H86u
-----END PGP SIGNATURE-----



More information about the Devoncornwall-pm mailing list