eval { $msg->send('smtp','mail.shs.siemens.com'); }; warn "Trapped error: $@\n" if $@; # code continues here