It doesn't have anything to do with Net::OpenSSH, because the vars in question get expanded in the string before the 'new' call is made. Have you printed the expanded string $user:$pass\@$host under both conditions (locals and module)? That's what I'd do first.