#!/usr/bin/perl -- use Tk; use Tk::Dialog; my $mw = tkinit; my $snot = "snot"; $mw->Label( -textvariable => \$snot )->pack;; $mw->Button( -text => 'wipe', -command => sub { my $d = $mw->Dialog( -title => "Title", -text => "Text", -buttons => [ "OK", "Cancel" ] ); $d->geometry('200x200+40+40'); $snot .= '('. $d->Show . ")\n"; $d->destroy(); undef $d; }, )->pack; MainLoop; __END__