I want to run a terminal emulator from perl script in a while/for loop on Windows XP. Following code does not wait for the first terminal emulator to close, it opens up the terminal emulator two times. Is there any way perl can wait until first terminal has exited?
$MY_VT = "c:/test/terminal.exe";
$i = 2;
while ($i) {
print "Execute $i\n";
system ($MY_VT)== 0 or die "issues running my_vt";
wait();
$i--;
}