Help for this page
$mw->Button( -text => "Submit", #-command => sub {exit} # no good, will exit whole program -command => sub{ $mw->destroy } # good )->pack();
.... Tk code omitted MainLoop; ... #get the error from your_command chomp(my $error = <ERROR>); print "error = $error\n";