I can confirm that your script works fine---no errors, but it's on Linux. To follow up on what salva recommended, syphilis wrote a ppm for Net::SSH2 back in November of 2006. You'll find it here
Comment on Re: Module Net::OpenSSH error child exited with code 255