views:

335

answers:

2

Hi

I have a set of .EXE commands. How do I get all those commands run in Perl as a single file? Whats the process to call the .EXE files in Perl?

+5  A: 

The Perl system() function will do this:

#!/usr/bin/perl -w

system("prog1.exe");
system("prog2.exe");
Greg Hewgill
don't forget to check exit codes from your system command, you might not want to run prog2 if prog1 failed
Oskar
+3  A: 

TThe way to call system commands from perl is to use

system("String containing command + args here")

or if you want to perform some processing on the output, you use backticks

`command + args here`

You can use all your normal perl string manipulation oneliners with the backtick as well.

workmad3