#.... my $main = MainWindow->new(); # Add this line to hide the window $main->withdraw; $main->title("Button Window"); $main->configure(-background=>'#c0c0c0'); $main->optionAdd('*BorderWidth' => 1); my $bottom = $main->Frame(-background=>'#c0c0c0')->pack(-expand=>0, -fill=>'both'); my $sub_button=$bottom->Button(-width=>40, -background=>"#c0c0c0", -fg=>'black', -text=>'CLICK ME', -font => ['Courier', 10], -command=>\&click); $sub_button->pack(-side => "bottom", -anchor => "s", -expand => "n", -fill => "none"); # Add these two lines to display the window after you have finished creating the GUI $main->deiconify; $main->raise; MainLoop(); #...