Perl Applications
Anonymous Monk
created: 2006-03-03 16:25:07
Hello,

Is Perl good for windows applications?

I want to build a program using Perl and have a GUI for the end user to operate on.

Basically I want to program a little application that lets the user click on a "browse" button and the File Dialog (to search for files on your comp) box displays. Then the user would add any text files he wants stored into a list. The list will then load up everytime windows starts up.

I'm pretty sure Perl can build such an application, but would Visual Basic probably be the way to go? Or is Perl just as capable? If I was to learn more about Perl TK, does that involve compiling the actual application for windows users to download and work properly? Reason, that I do not want this jus tto be a perl script, is that not all people have Perl installed on their comps to execute the script.

Thanks for taking your time to read this. May be an odd post, but just need some feedback be4 I really get started on this little project. Thanks.
Re: Perl Applications
created: 2006-03-03 16:36:34

If you want to do Visual Basic-like stuff in Perl, have a look at the GUI Loft, which is quite nice for writing user interfaces in Perl. Other options are Tk and WxPerl.

For distributing a Perl application with Perl included, look at PAR.

Re: Perl Applications
created: 2006-03-03 18:07:21
Well most people with Perl on Windows, get it from ActiveState. Tk comes standard with ActiveStatePerl. Here is a sample to get you started.
#!/usr/bin/perl
use warnings;
use strict;
use Tk;


 my @types =(
  ["All files",   '*'],
  ["C files",    [qw/.c++ .cpp .c/]],
  ["Log files",      [qw/.log/]],,
  ["Text files",     [qw/.txt/]],
 );

my $mw = new MainWindow ( ) ;

my @files;

$mw -> Button ( -text => 'Select Files ' ,
                 -command => \&select_files
                  )-> pack(-padx=>5, -pady=>5) ;
MainLoop ( ) ;

sub select_files {
    my $return_ref = $mw ->getOpenFile (
                      -initialdir => '.',
                      -filetypes => \@types,
                      -multiple => 1) ;

    foreach my $file( @{$return_ref} ){
        print "Result ", $file, "\n" ;
       }
}


I'm not really a human, but I play one on earth. flash japh
Re: Perl Applications
created: 2006-03-03 18:38:46
Some other options:

wxperl for multi-platform GUI coding in Perl and the utilities offered by Indigo Star for packaging things up.

Re: Is Perl good for Windows applications?
created: 2006-03-05 07:22:58
I like Wx::Perl (link above) and have found it relatively easy to build a file list panel which you drag files or folders onto and it remembers and lists all the contents to do something to them. It may take a little while to get used to it but is very powerful.

Also have used Win32::GUI a couple years ago, it was easy for really simple things but wasn't what I was looking for. The wxperl mailing list also has good people responding to questions, I'd recommend it.

perlmonks.org content © perlmonks.org and Anonymous Monk, cbrandtbuffalo, Corion, mattr, zentara

prlmnks.org © 2006 edmund von der burg (eccles & toad)

v 0.03