#!perl -w use strict; use Tk; my $mw = MainWindow->new(); my $button = $mw->Button( -text => 'killme', -command => $mw->destroy(), )->pack; MainLoop; print "After first MainLoop\n"; my $mw = MainWindow->new(); my $button = $mw->Button( -text => 'exit', -command => exit, )->pack; MainLoop; print "this won't be printed...\n";