Since I never expected people to use the module who had password-less ssh set up (I mean, the *whole point* of the module is to send a password via Expect), I never accounted for that possibility. However, someone has pointed out that he's in a loop and some machines require passwords and some don't. Since that's probably going to be a fairly common scenario, I'll need to deal with it now.
Ben Trott, save me!!!
There's an easy way, and a really easy way (Score:2)
Since that's probably going to be a fairly common scenario, I'll need to deal with it now.
No you don't, just learn from history: "No patch? Oh, well. Take care." :)
Seriously, if you decide you want to tackle it, I don't think it will be too hard. Expect with undef timeout, if you get eof, the command completed without asking for a password, if you get a password prompt, send the password and then expect for eof. Don't forget to omit any steps you might previously have taken to insist that the
J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers