in reply to Changing the button function

Use the configure method to change a widget:
#!/usr/bin/perl use warnings; use strict; use Tk; sub quit_button { my $button = ${+shift}; $button->configure(-text => 'Quit', -command => sub { exit }); } sub flip_button { my $button = ${+shift}; $button->configure(-text => 'Press me again', -command => [ \&quit_button, \$button ]); } my $mw = 'MainWindow'->new; my $button; $button = $mw->Button(-text => 'Press me', -command => [ \&flip_button, \$button ], )->pack; MainLoop();
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ