use strict; use warnings; use Tk; use Tk::Dialog; my $mw = MainWindow->new; my $label = $mw->Label (-text => "Foo bar bang")->pack; my $button = $mw->Button (-text => "Bar bang foo", -command => \&popup)->pack; MainLoop; sub popup { my $dialog = $mw->Dialog; $label->configure (-text => "Bar bang foo"); $dialog->Show (); }