edpatterson
IS-IT--Management
- Feb 24, 2005
- 186
I need to capture the output of a DOS executable into a perl script.
'executable' could be any valid DOC exe|com file that writes to the screen.
I tried $response = system('executable'); but only recived the errorlevel of the apps.
Thanks,
'executable' could be any valid DOC exe|com file that writes to the screen.
I tried $response = system('executable'); but only recived the errorlevel of the apps.
Code:
my $response
$servers = qw(one two three four five);
foreach($servers){
$response = system('executable');
if($response == 'string'){
do_someting();
}else{
do_something_else();
}