#!/usr/bin/perl use warnings; use strict; use Tk; my $mw = MainWindow->new( -width => 200, -height => 200 ); my $text = $mw->Text( -height => 10, -width => 40, -wrap => 'word' ); $text->pack( -side => 'top', -fill => 'both' ); $text->bind( '' => \&callback ); $text->bind( '' => \&callback ); $text->bind( '<>' => \&callback ); #proper way to detect a paste event? MainLoop; sub callback { if ( $text->editModified() ) { print "text has been modified\n"; $text->editModified(0); } }