jonschwartz has asked for the wisdom of the Perl Monks concerning the following question:

I have a script using Mime::Lite to send messages via a local SMTP server.

The script currently dies if the SMTP server goes down for some reason. I want it not to do that but I can't find a method for Mime::Lite to keep it from shutting down the whole script because of an error.

Please help, Monks!

Replies are listed 'Best First'.
Re: Mime::Lite prematurely ends the script
by Anonymous Monk on Dec 10, 2009 at 20:03 UTC
    eval { die "shutting you down"; 1; } or print "Tried to shut me down: $@\n"; __END__ Tried to shut me down: shutting you down at - line 2.
Re: Mime::Lite prematurely ends the script
by zwon (Abbot) on Dec 10, 2009 at 20:04 UTC

    Use eval and do not use <pre> tags

Re: Mime::Lite prematurely ends the script
by jonschwartz (Initiate) on Dec 11, 2009 at 12:55 UTC
    You guys saved me! Win! Thanks again.