Control::CLI may be a bit more tolerant to this stupidity. I can't speak to your problem directly, but I've been successful in getting annoying stuff to automate done with it. It does require keys though. No interactive login, like you appear to be using.