General way to run an exe with errors written to a file

General way to run an exe with errors written to a file

am 20.09.2007 02:04:27 von bencejohn

Is there a purely Perl way to do the following (i.e., without relying
on a system specific call)?

use strict;
use warnings;
system("foo.exe bar > errs 2>&1");


Thanks

Re: General way to run an exe with errors written to a file

am 20.09.2007 04:08:29 von Ben Morrow

Quoth bencejohn@gmail.com:
> Is there a purely Perl way to do the following (i.e., without relying
> on a system specific call)?
>
> use strict;
> use warnings;
> system("foo.exe bar > errs 2>&1");

IPC::Run

Note that what you have above works perfectly well under Unix, which
includes Mac OS X, and WinNT (including 2k/XP/&c.); this may be portable
enough for your purposes.

Ben