in reply to Tk bind question

The problem is caused by the fact that you are binding <Key-Escape> to sub { exit }. If you lookup exit in perlfunc, you find it performs the syscall to shutdown your whole program. What you need instead is to have a closure on $x which call's the relevant function to destroy the MainWindow.
for (@ARGV) { my $x = MainWindow->new; $x->bind("<Key-Escape>", sub { $x->destroy }); }

--
integral, resident of freenode's #perl