Real Perl has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks,

I am using use Tk::DirTree; use Tk::DirSelect; modules so I can have my user chose a directory. The description on CPAN says: "Displays the DirSelect widget and returns the user selected directory or undef if the operation is canceled."
Does anyone know how I get the returned value of what the user has selected after he pushed "ok"?
I'm tempted to use the cget command, but I don't know the syntax, the object I'm calling cget on...

Thank you for your help,

Claire

Replies are listed 'Best First'.
Re: Tk::DirTree, TK::DirSelect
by GrandFather (Saint) on Aug 08, 2005 at 04:02 UTC

    The following works for me:

    use warnings; use strict; use Tk::DirSelect; my $main = MainWindow->new (); my $ds = $main->DirSelect(); my $dir = $ds->Show('.'); print $dir;

    Perl is Huffman encoded by design.
      Thank you so much! I think it is high time I take a break -- I can't think straight!