use Tk; use Tk::Dialog; $mw = MainWindow->new(); $mw->Button(-text => "Show", -command => sub {$mw->DialogBox()->Show();})->pack; MainLoop();