use strict; use warnings; use Tk; my $mainWindow=MainWindow->new; my $textEntry = $mainWindow->Entry(-state => 'normal') -> pack( -side => 'bottom', -expand => 'BOOLEAN'); $textEntry -> bind('' => &get); sub get { my $text = $textEntry -> get(); print "$text\n"; } MainLoop;