in reply to calling a sh command which then asks for a password

It might be easier for you to consider using either the Expect or Expect::Simple modules for this.

If the program in question is making a connection to a remote device, such as telnet to a router or ssh to a server, then you may wish to look at a module specifically for that, such as Net::Telnet or Net::SSH/Net::SSH::Perl.

Others perhaps can help more-I look forward to their comments-but I hope that helps a little. Good luck, and please let us know how it goes and what works for you.

  • Comment on Re: calling a sh command which then asks for a password