in reply to Using IPC::Run
Many commands that start programs, like system, exec, and IPC::Run::start, if given a list will directly execute the given program with the given arguments, without using the shell at all. Since it's the shell's job to handle output redirection, with no shell it doesn't happen.
It looks like you have one workable solution in your responses already, which is to use IPC::Run's speicial syntax for output redirection, something like IPC::Run::run \@cmd, '>', $tape. The docs say you can also pass a single string to IPC::Run::run, which will be passed to the shell, so IPC::Run::run("/bin/cpio -ov >$tape") might also work. Finally, for something so simple, consider just system.
Hope this helps!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using IPC::Run
by pc88mxer (Vicar) on Jul 04, 2008 at 07:59 UTC | |
by sgifford (Prior) on Jul 04, 2008 at 14:36 UTC |