use strict; use warnings; use Tk; my $mw = Tk::MainWindow->new(); my $entry = $mw->Entry()->pack(); my $var = '123'; # sub in []-klammern packen $entry->bind('', [sub{ $entry->configure(-text => "$_[1]\n"); }, $var]); $mw->MainLoop();