use Tk; use Data::Dumper; $mw = new MainWindow; foreach (qw/Vorname Nachname Strasse PLZ Ort/) { $mw->Label(-text => $_)->pack(); $mw->Entry(-textvariable => \$results{$_})->pack(); } $mw->Button(-text => "Ok", -command => sub { foreach (keys %results) { print "$_: $results{$_}\n" } })->pack(); $mw->Button(-text => "Exit", -command => sub { exit } )->pack(); MainLoop();