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