#!/usr/bin/perl use strict; use warnings; use Tcl::pTk; use Tk::Text; my $mw = MainWindow->new(); my $text = $mw->Text()->pack(); $text->bind('<2>', [sub {print "something"}, Ev('X'), Ev('Y'), ]); MainLoop;