in reply to Expect.pm question
I'd setup authorized keys so you're not prompted for password, rather than putting the password in your script. Then you might not even need Expect:
system("ssh sysadmin@$server listdev"); [download]