in reply to How do I stop SSH Module from dieing?
Wrap the code which is dieing in an eval (the BLOCK form, not the string); Check $@ afterwards and see if the connect was successful.