in reply to a Tk object who knows who he is ?

Another trick to use, is to stick all the buttons in a hash. The nice thing about that way, is that you can easily perform operations on the buttons from another place in the script (without having to walk the widget's descendents tree). For example:
#!/usr/bin/perl -w use strict; use warnings; use Tk; my %b; #hash to hold button names my @button_names = qw( blue red green white purple orange ); my $mw = new MainWindow(-title => 'Another Button example'); my $fr = $mw->Frame()->pack(-fill => 'x'); foreach my $name (@button_names) { $b{$name} = $fr->Button(-text => $name, -bg => $name, -command => sub{ print "You clicked on $b{$name} which is ", $b{$name}->cget(-bg),"\n " }, )->pack(-side => 'left'); } $mw->after(5000, sub{ foreach my $button (keys %b){ if($button eq 'red'){next} $b{$button}->configure(-bg => 'grey'); } }); MainLoop;

I'm not really a human, but I play one on earth. Cogito ergo sum a bum