in reply to Access an executable from perl script

There are a few ways to run external executables from perl. The easiest, and what you probably want, is backticks: see `STRING`. For this, your command might look like:

$abc_cmd = `abc.exe -i $input_file -o $output_file >null`;

Other possibilities include system, open and IPC::Open3, for which you can use perlipc for reference.

Update: (as per JavaFan's comment) But of course, if you redirect your output (with >null) or put it in some output file (with -o $output_file, then why would you expect to capture it?

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Replies are listed 'Best First'.
Re^2: Access an executable from perl script
by JavaFan (Canon) on Feb 28, 2012 at 23:16 UTC
    $abc_cmd = `abc.exe -i $input_file -o $output_file >null`;
    I don't get this. You're redirecting the output of abc.exe to the file null, and then you want to capture the output of that.

    What do you expect $abc_cmd to be afterwards?