good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: Access an executable from perl scriptby kennethk (Abbot) |
on Feb 28, 2012 at 23:03 UTC ( [id://956790]=note: print w/replies, xml ) | Need Help?? |
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.
In Section
Seekers of Perl Wisdom
|
|