#!/usr/bin/env perl use strict; use warnings; use Tk; my $mw = MainWindow->new; $mw->Button(-text => 'Problem: exit', -command => sub { exit } )->pack; $mw->Button(-text => 'Solution: destroy', -command => sub { $mw->destroy } )->pack; MainLoop; print "After MainLoop\n"; #### $ pm_1165366_tk_post_loop.pl # Test Problem $ pm_1165366_tk_post_loop.pl # Test Solution After MainLoop $