in reply to Re^3: How to use pty for both STDERR AND STDOUT in IPC::Run, while doing something different with each?
in thread How to use pty for both STDERR AND STDOUT in IPC::Run, while doing something different with each?

Well, how would you structure 1) the run line and 2) the program in general? Go ahead, the node is your oyster..

_________________________________________________________________________________
Without me, it's just aweso

  • Comment on Re^4: How to use pty for both STDERR AND STDOUT in IPC::Run, while doing something different with each?

Replies are listed 'Best First'.
Re^5: How to use pty for both STDERR AND STDOUT in IPC::Run, while doing something different with each?
by samtregar (Abbot) on May 22, 2006 at 22:06 UTC
    I'd just let perltidy handle it. Here's what it does with the run line:

    run(\@cmd, '>pty>', sub { print "$_[0]"; }, '2>', sub { chomp $_[0]; print "<b>$+_[0]</b>\n"; }) or die("Error executing child. Child returned $&\n");

    That's still pretty ugly, but I do find it significantly easier to read.

    -sam