in reply to win32-FileOp module for strawberry

G'day srikrishnan,

Win32::FileOp was last updated about a decade ago. I suspect it is abandonware.

See "Bug #120791 for Win32-FileOp: Crash in BrowseForFolder()". This was raised six years ago; its Status is still "new".

Here's the guts of what I think you want:

#!/usr/bin/env perl use strict; use warnings; use Tk; my $mw = MainWindow::->new(); $mw->Button( -text => 'Select directory', -command => sub { my $dir = $mw->chooseDirectory(); # Do something with $dir # You probably want more than this demo test: if (defined $dir) { warn "Directory selected: '$dir'\n"; } else { warn "No directory selected.\n"; } }, )->pack(); MainLoop;

I strongly advise that you

— Ken

Replies are listed 'Best First'.
Re^2: win32-FileOp module for strawberry
by Anonymous Monk on Nov 05, 2022 at 04:08 UTC

    Hi kcott

    Thanks for your response and alternate suggestion

    in my original script i have used strict and warnings. I used to do that always.

    Regards,

    srikrishnan

      "Thanks for your response and alternate suggestion"

      You're welcome.

      "in my original script i have used strict and warnings. I used to do that always."

      If you do that always, that's great; however, if you don't show it in your code, we don't know.

      An SSCCE is supposed to be code that we can run and reproduces your problem. Had you included those pragmata, your SSCCE would have output something along the lines of:

      Global symbol "$BrowseFrame" requires explicit package name ... Global symbol "$filepath" requires explicit package name ... Execution ... aborted due to compilation errors.

      So, without them, your SSCCE is not representative of your real code; and with them, your SSCCE cannot be run.

      Also, for future reference, the first "S" in SSCCE stands for "Short". Please exclude code that is not relevant to the problem. In this case, all of the cosmetic parts (colours, padding, and so on) could have been omitted; this allows you, and us, to focus on the parts that matter.

      And just so you know, I'm not trying to beat you over the head with a rule book. Helping us to help you will generally result in faster and better responses.

      — Ken