in reply to Error trapping while capturing stdout

Doesn't that only redirect the STDERR of sed, not of $cmd? In any case, you're better off using IPC::Open3 (read perlipc on how to manage children), do your transformation in perl, and merge your streams (check out select(RBITS,WBITS,EBITS,TIMEOUT) or IO::Select) in perl.
  • Comment on Re: Error trapping while capturing stdout

Replies are listed 'Best First'.
Re^2: Error trapping while capturing stdout
by ccarden (Monk) on Sep 14, 2004 at 16:03 UTC
    I will look at IPC::Open3 based on your suggestion, but I am now very leary of introducing modules into an solution if they don't come with the standard Perl load. It adds a level of complexity to support. I'm willing to handle that extra complexity, if the module delivers above and beyond expectations. Otherwise, it may be better to stick with core Perl solutions.

    Thanks for your input.

      I think it does come with perl; it came with mine, and it's not in site/. It's really just a wrapper for fork()+exec(), so no biggie if you don't use it. Check out the perlipc doc/man page for an example using fork()+exec().