use Tk; $mw = MainWindow->new; # Create necessary widgets $f = $mw->Frame->pack(-side => 'top', -fill => 'x'); $f->Entry(-textvariable => \$filename)->pack(-side => 'left', -anchor => 'w', -fill => 'x', -expand => 1); $f->Button(-text => "Exit", -command => sub { exit; } )-> pack(-side => 'right'); $t = $mw->Scrolled("Text")->pack(-side => 'bottom', -fill => 'both', -expand => 1); MainLoop;