The answer to this will depend on how your Perl script needs to interact with the external program.
Here's a non-exhaustive list of possibilities:
-
You want to wait for the program to finish and check its exit status: system may be best.
-
You want the output from the program: qx{...} (or `...`) may be the best choice — see perlop: Quote-Like Operators for details.
-
You want control over how (one of) input or output is written to or read from the program: perhaps choose open with a mode of '|-' or '-|' — see perlipc: Using open() for IPC for more details.
-
See perlipc for more complex scenarios, such as bidirectional and client/server communication.
-
There are also many modules that may do exactly what you want, e.g. the built-in IPC::* modules.
If you provide a clearer picture of your requirements, we can provide a better answer.