$widget->my_mega_widget(-command => sub { $self->do_something });
You want a closure. We've had a number of discussions recently on closures, so I'm not going to repeat them, but urge you to search with that term.
In reply to Re: callbacks in Tk
by Tanktalus
in thread callbacks in Tk
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |