http://www.perlmonks.org?node_id=206291


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

The problem maybe the leading newline produced after the "!"; ... if you try the following it may work better :

open2(\*Reader,\*Writer, "/usr/tools/prog start"); Writer->autoflush(); print "password\n";

This may still not work. Programs built for security (like ssh) often open a new TTY to prevent snooping ... if that's the case, it also prevent STDIN redirections like this.


from the frivolous to the serious