share (my $clientline); # in the main code, referenced here for clarity. my $event = new Wx::PlThreadEvent( -1, $ID_OUR_EVENT, $clientline); Wx::PostEvent($panel, $event );