use Tk; $mw = tkinit; $mw->Text->pack; $mw->bind('', sub { print "save something...\n" }); MainLoop;