my $szPerlExe = $this->{$this->{choPerlExecutable}->GetStringSelection()}; my $szShell = $this->{stcShell}->GetText(); $szShell =~ s/"/\\"/g; my $szCommand = $szPerlExe.' -e '.'"'.$szShell.'"'; $this->{wProcessId} = Wx::NewId(); $this->{hProcess} = Wx::Process->new($this, $this->{wProcessId}); $this->{hProcess}->Redirect(); $this->{hProcess}->CloseOutput(); my $wProcessPid = Wx::ExecuteCommand($szCommand, wxEXEC_ASYNC|wxEXEC_NOHIDE, $this->{hProcess}); $this->{wProcessPID}->{$wProcessPid} = $szTimeStamp; $this->{tmrProcessRunning} = Wx::Timer->new($this, $this->{wProcessId}); $this->{tmrProcessRunning}->Start(500); EVT_TIMER($this, $this->{wProcessId}, \&ProcessRunning_OnTimer); EVT_END_PROCESS($this, $this->{wProcessId}, \&ProcessEnded);