my @test = system($command) ;
print @test ;
This will give you the command output. Example:
#!/usr/bin/perl -w
use strict ;
my @test = system("dir") ;
print @test ;
Will give you: Volume in drive E is E_Drive
Volume Serial Number is XXXX-XXXX
Directory of E:\TempCode\test
08/06/2002 11:05a <DIR> .
08/06/2002 11:05a <DIR> ..
08/06/2002 11:05a 1,336 systemCommand.pl
1 File(s) 1,336 bytes
2 Dir(s) 1,629,966,336 bytes free
0
While:
#!/usr/bin/perl -w
use strict ;
my @test = system("dirt") ;
print @test ;
Will give you:
'dirt' is not recognized as an internal or external command,
operable program or batch file.
256
This should be usefull in at least telling you if the command is being executed and what the results are.
"Nothing is sure but death and taxes" I say combine the two and its death to all taxes! |