in reply to Re: 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?

better?

_________________________________________________________________________________
Without me, it's just aweso

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

Replies are listed 'Best First'.
Re^3: 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 20:02 UTC
    Moderately. That run() line is still nuts and you've got a lot of lines with far too few spaces in the top chunk. But's definitely a lot more readable now.

    -sam

      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

        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