in reply to forcing STDIN with windows
You could also use Win32::GuiTest.
use Win32::GuiTest qw(FindWindowLike SetForegroundWindow SendKeys); system("start p.bat"); # start ensures that the progra +m opens in a new window sleep(1); # give p.bat a chance to load my @win = FindWindowLike(0, "^p.bat"); # find p.bat's window (maybe mo +re than one) SetForegroundWindow($win[0]); # bring the first p.bat window +to the foreground SendKeys("y"); # send a keypress to the active + window in this case a "y" __DATA__ For this example, p.bat contains one line: pause
|
|---|