in reply to Correct way to capture command output to a file in Perl.

I would probably just use Windows redirection:  `example.exe >output.txt`;Then read that file.

Replies are listed 'Best First'.
Re^2: Correct way to capture command output to a file in Perl.
by morgon (Priest) on May 02, 2013 at 15:02 UTC
    If you do it like that you would not use backticks but system() as you would not capture any output.

    But I would not do it like that as in the error-case it is more difficult to determine what went wrong (e.g. the command you call may be able to run, but may not be able to write to the file).