in reply to deref question

Not sure how you used Tk::Entry. If you use the textvariable option of Tk::Entry, it becomes much more simple for you to set/get the content of Tk::Entry (avoid passing params to your callback function, and do all those handling by yourself, that is more complex):
use Tk; use strict; my $entry_val = "initial value"; my $mw = new MainWindow(title => "demo"); $mw->Entry(width => 20, textvariable => \$entry_val)->pack; $mw->Button(text => "click", command => sub {print $entry_val, "\n";}) +->pack; MainLoop;