in reply to How can I un-bind a button in Perl Tk

Can I do something like below ? Will it serve my purpose ?

What happens when you try? Yes, that should effectively unbind, and if you're using the latest Tk

You could always weaken before giving it to Tk

#!/usr/bin/perl -- use strict; use warnings; use Tk; use Scalar::Util qw/ weaken /; my $mw = tkinit; my $b = $mw->Button->pack; $b->bind( q/<1>/, #~ sub { $self->onEnter($label, $obj_A) ; }, [ sub { warn qq/@_/; my $button = shift; my ( $self, @rest ) = @_; $self->onEnter(@rest); }, weaken( $self ), weaken( $label ), weaken( $obj_A ), ] ); MainLoop; __END__