in reply to Return value from Button event

Are you looking to put the information in a listbox?
#!/usr/bin/perl use warnings; use strict; use Tk; my $mw = MainWindow->new; $mw->title("Something"); my $but_browse = $mw -> Button(-text=>"BROWSE", -command =>\&load_listbox) -> pack(-side => 'left'); my $lb = $mw->Listbox()->pack( -side => 'left' ); MainLoop; sub load_listbox { my $filepath = $mw->chooseDirectory() or return(); opendir (DIR, $filepath) || die("Cannot open directory"); $lb->delete(0, 'end'); $lb->insert('end', grep { ! -d } readdir DIR); close DIR; print "$filepath\n"; }

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh