in reply to curselection in listbox

It is too early when you call the values by curselection (before MainLoop, i.e. before the user had a chance to interact with the window). Try something like

my $mw=new MainWindow; $lb = $mw->Listbox( -selectmode =>"multiple")->pack; $lb->insert('end', @dir); $mw->Button(-text => "ok", -command=> \&dosomething)->pack; MainLoop; # ---------------------------- sub dosomething { my @selected = $lb->curselection; print scalar @selected; $mw->destroy(); } # dosomething

(code not tested)

due to the callback, &dosomething is called when the button is pressed, i.e. while MainLoop is running

Best regards,
perl -e "s>>*F>e=>y)\*martinF)stronat)=>print,print v8.8.8.32.11.32"