in reply to Tk Mainloop - no exit.

Here's a few things you can do:

Change the -command to sub { exit } - you don't need to explicitly call destructors.

Remove the print and exit lines after Mainloop. You should normally only have subroutines, POD, DATA blocks, etc. after MainLoop - not statements such as these.

Call your subs like sub(); not ⊂ - see perlsub.

Add use strict; and use warnings; to the top of your code - act on the various messages these report.

Take a look at the widget demo for examples of writing Perl/Tk code.

-- Ken

Replies are listed 'Best First'.
Re^2: Tk Mainloop - no exit.
by Laotsu (Initiate) on Nov 09, 2010 at 04:46 UTC
    Thanks Ken,

    I made the cosmetic changes in subroutine calls. Added strict & warnings, and fixed 'explicit package names' warnings. No change in outcome.

    I did not replace the destructor with 'exit' or remove the commands after mainloop, since the whole point it to be able to continue the program after mainloop exits. The problem is that it doesn't exit.

    I do not understand the problem with having code after mainloop exits - 'normal' or not. Everything I know tells me the program is not required to end when the GUI does, anymore that it needs to end after a print statement.

    I'm still clueless.