use Tk; # create first main window $mw = MainWindow->new( -title => 'Test1' ); # if I remove the following line, no "segmentation fault" occurs. # even no pack is required to get the "segm fault" $label = $mw->Label(); # Display first window Tk::update($mw); # and destroy it $mw->destroy(); # create second main window $mw1 = MainWindow->new( -title => 'Test2' ); $label1 = $mw1->Label()->pack(); # main loop MainLoop;