my $status = $mw -> messageBox( -message=>"Do u want to start the process..?", -type=>'yesno',); if($status eq "Yes") { $choice = "Yes"; print "$choice\n"; exit; }else{ $choice = "No"; } } ) -> pack(-side =>'right',-expand => 0); $status->transient($mw); # will work, but causes harmless errors reported