$listbox = $mw -> Listbox (-selectmode => "single") -> pack(); $optionmenu = $mw -> Optionmenu (-options => [qw/foo bar bla blubb/] -variable => \$var, -command => \&subfunktion ) -> pack(); sub subfunktion{ opendir (FOO, "/usr/share/$var") || die "öffnen: $!"; @foo = readdir FOO; closedir FOO || die "schließen: $!"; foreach $bar (@foo){ $listbox -> insert ('end', '$bar'); } }