run( \@cmd, '>pty>', sub { print "$_[0]"; }, '2>pty>', sub { chomp $_[0]; print "$_[0]\n"; } ) or warn("Error executing child. Child returned $?\n");