use Tk; my $mw = Tk::MainWindow->new( -title => "TEST"); $mw->bind( '', [sub {print "Button a has been pressed\n"}] ); $mw->bind( '', [sub {print "Button a has been released\n"}] ); MainLoop;