$sub_pid= open $pipe, "-|", "${tab}_${date}.sh 2>&1" or die "Can't execute $tab : $!\n"; #### my $button = $popup->Button( -text => 'Kill', -command => [sub{`kill $sub_pid 2>&1` && warn "Can't kill subprocess: $sub_pid\n"}],-background=>'slate grey'); $button->pack;