How does that help? The return value that's being stuffed into $login_output is what needs to be tested to see if run_ssh() was successful or not. $@ and $! are meaningless when they are not the mechanism being used. How about suggesting testing the proper value?