in reply to Tk - intercepting alt-f4 and the like

What you need is:
#!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 }
This should work, like you need it
----------------------------------- --the good, the bad and the physi-- -----------------------------------