Use Tk; my $mw = new MainWindow(-background=>'#3B5998'); my $frm_name = $mw -> Frame(); my $lab = $frm_name -> Label(-text=>"Enter your feedback"); my $ent = $frm_name -> Entry(); my $but = $mw -> Button(-text=>"Submit", -command =>\&push_button); $lab -> grid(-row=>2,-column=>1); $ent -> grid(-row=>2,-column=>2); $frm -> grid(-row=>2,-column=>1,-columnspan=>2); $but -> grid(-row=>4,-column=>1,-columnspan=>2); MainLoop; sub push_button { my $txt=$ent -> get(); $mw -> messageBox(-type=>"ok", -message=>"You printed this $txt"); }