#!perl -w use strict; use Tk; my $mw = MainWindow->new(); $mw->protocol('WM_DELETE_WINDOW', \&ExitApplication); MainLoop; sub ExitApplication { print ("Exiting\n"); # do some cleanup } #### ----------------------------------- --the good, the bad and the physi-- -----------------------------------