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

Anyone know of lightweight module that provides JUST getopenfile/getsavefile for MS Windows? I've searched CPAN and other, but closest I have found is Win32::GUI, but then I might just as well use Tk.

I am trying to make some command line scripts friendlier by adding file selector pop-ups. Don't need more GUI than that.

  • Comment on Just getopenfile/getsavefile for MS Windows?

Replies are listed 'Best First'.
Re: Just getopenfile/getsavefile for MS Windows?
by hominid (Priest) on Oct 08, 2014 at 20:45 UTC
    I don't know much about it, but Prima may be worth a try. Here's an example from CPAN.
    #!perl -w use strict; use warnings; use Prima qw(Application); use Prima::StdDlg; my $open = Prima::OpenDialog-> new( filter => [ ['Perl scripts' => '*.pl'], ['All' => '*'] ] ); print $open-> fileName, " is to be opened\n" if $open-> execute; # save a file my $save = Prima::SaveDialog-> new( fileName => $open-> fileName, ); print $save-> fileName, " is to be saved\n" if $save-> execute; # open several files $open-> multiSelect(1); print $open-> fileName, " are to be opened\n" if $open-> execute;

      This looks interesting, but really seems to another Tk/gtk/qt/etc

      Thanks (Sorry for late reply. I thought I had replied.)

Re: Just getopenfile/getsavefile for MS Windows?
by Anonymous Monk on Oct 08, 2014 at 21:43 UTC

    I am trying to make some command line scripts friendlier by adding file selector pop-ups. Don't need more GUI than that.

    win32 file dialog, win32 file dialog, -> Win32::FileOp/Win32::FileOp - Module for file operations with fancy dialog boxes, for moving files to recycle bin, reading and updating INI files and file operations in general.

      In terms of library, this looks like it might just be the kind of thin layer over the Win32 API I was thinking of.

      Thanks. (sorry for late reply. I thought I had replied)

Re: Just getopenfile/getsavefile for MS Windows?
by jellisii2 (Hermit) on Oct 09, 2014 at 11:49 UTC
    Is the the library (and all of its support) that you have to tote around, or the work to get it done that's the issue with Tk? Tkx makes this absurdly easy if it's the work.

      In the library.

      I know Tk fairly well, so no big deal.

      Anyway, thanks.

Re: Just getopenfile/getsavefile for MS Windows?
by zentara (Cardinal) on Oct 09, 2014 at 16:21 UTC
    but then I might just as well use Tk.

    Many people have come to that same conclusion. :-)


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

      Often, it is more productive to use what one already knows.

      FWIW, the people - including software developers - for this particular client of mine are especially adverse to the command line. With other clients, it has been enough to make sure to wait for input (on STDIN) when the (other command line oriented) program is started without parameters or options (as happens when a user double-clicks on the file). And, of course, state in the shown help text that the program needs to run from the command line. Since the programs I'm trying "friendly up" just read 1 or 2 files and write another, the only GUI needed is file open/save dialogs.