#!/usr/bin/perl # https://perlmonks.org/?node_id=1231953 use strict; use warnings; use Tk; my $mw = MainWindow->new; $mw->geometry( '+300+300' ); my $button = $mw->Button(-text => 'Test', -command => sub { print "B1 released\n" }, )->pack; $button->bind('' => sub { print "bind release\n" } ); MainLoop;