#!/usr/bin/perl -- use strict; use warnings; use Tk; my $mw = tkinit; $mw->Button( -text => "Button", -command => sub { my $d = $mw->Dialog( -title => "Title", -buttons => [ "OK", "Cancel" ] ); $d->geometry('200x200+40+40'); warn 'Show ', $d->Show; $d->destroy; undef $d; }, )->pack; $mw->MainLoop; __END__