I've been working on a Perl module that makes sending email messages a breeze, but one problem I had is that the Perl module MIME::Lite has a nasty way of failing when something goes wrong. I could not "catch" it's errors with
warn, so after a little research, I found out how to deal with this problem using
eval. According to one text, using eval is the only mechanism Perl has for exception handling.
Here's what I was doing that didn't work: