use Wx::Perl::ProcessStream qw( :everything ); # setup the stream handlers EVT_WXP_PROCESS_STREAM_STDOUT ( wxperl_window, \&evt_process_stdout_err ); EVT_WXP_PROCESS_STREAM_STDERR ( wxperl_window, \&evt_process_stdout_err ); EVT_WXP_PROCESS_STREAM_EXIT ( wxperl_window, \&evt_process_exit ); EVT_WXP_PROCESS_STREAM_MAXLINES ( wxperl_window, \&evt_process_maxlines ); the handlers (here both the childs stdout & sterr are handled in the same handler) sub evt_process_stdout_err { my( $self, $event ) = @_; $event->Skip(1); my $process = $event->GetProcess; my $clientline = $event->GetLine; $clientline=~s/"//g; $clientline=~s/\s+$//g; # string off all quotes and trailing whitespace # show it in the test window $detailsInfo->AppendText("$clientline\n"); # if the output line ends with identified line end, then it is about to be a prompt if ($clientline=~m/($specialeol)$/) { my $textvalue = Wx::GetTextFromUser($clientline, "pre exit prompt", "",$self) ; $process->WriteProcess("$textvalue\n"); } } sub evt_process_exit { my ($self, $event) = @_; $event->Skip(1); my $process = $event->GetProcess; my $line = $event->GetLine; my @buffers = @{ $process->GetStdOutBuffer }; my @errors = @{ $process->GetStdErrBuffer }; my $exitcode = $process->GetExitCode; $process->Destroy; } the startup (this replaces all the thread goo) my $proc1 = Wx::Perl::ProcessStream::Process->new($command, 'somelabel', wxperl_window)->Run;