Re: Implementing Mail::SRS in MIMEDefang

"Michael Faurot" <[email protected]> Sun, 03 Oct 2004 17:56:55 -0400
Newsgroups gmane.mail.spam.srs.general
Message-ID <[email protected]>
In article <[email protected]> you wrote:

> The "die" statements are quite the standard way of doing things in Perl
> modules. So this is actually really a Perl question.

I thought my difficulty might involve something like this as I haven't
had much reason to use modules, until now.

> At any rate, you should enclose SRS calls in an 'eval' function, which will
> return undef upon die. Like so:
[...]
> my $address;
> if (eval {$address = $srs -> reverse ($to)}) {

This does indeed solve my difficulties.  Thanks!

Perhaps example code using eval could be incorporated into the POD
documentation?  Presumably someone that does enough of this stuff, probably
already knows that they should use eval, but for folks like me that are
looking at the docs for example code just to get something working,
would appreciate it. :)