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