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

I'd like to learn how to use Perl to do Windows programming. What are the best ways for me to learn? This book is a few years old http://www.oreilly.com/catalog/lperlwin/ is it dated or is it still a good book? What other books and sources can I look at?

I'd like to do a lot of GUI stuff on Windows and I'd like to be able to get into anything else Perl will let me do on Windows.

I looked at some packages on CPAN but it seems like a bad source to learn from.

Don't hate me becuase I'm beautiful a Windows developer.

Thanks.

Replies are listed 'Best First'.
Re: Windows programming
by BrowserUk (Patriarch) on Sep 30, 2003 at 15:50 UTC
    I'd like to learn how to use Perl to do Windows programming

    That's a very open question. What is your ultimate goal?

    Which is more important? Learning perl or learning to program windows?

    For example. If your goal is learning perl but you are currently restricted to using a windows box, but you antisipate wanting to write gui apps that are portable to other platforms then using a cross-platform gui library like Tk or Wx would be paramount.

    Conversely, if your aim is to learn more about programming Win323, and your use of perl is just a vehicle for that learning, then you might want to look at Win32::GUI.

    Theoretically, anything you could do from C/C++ or .NET or VB is possible to do from perl, but actually doing it is a different matter. The currently available libraries like Win32::API and Win32::APi::Prototype make it possible to access the native APIs, but doing so for anything other than simple queries is still complicated and messy.

    Some of the more often used APis have be encapsulated in perl modules Win32::* that simplify and perlify the underlying APIs, but the Win32 API set is vast, and grows with every release, and it is unlikely that there will ever be enough demand on many parts of it to warrent the time to construct perlish interfaces to them.

    So, without a clearer picture of what your goals are, it's difficult to advise on the best way for you to go.


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller
    If I understand your problem, I can solve it! Of course, the same can be said for you.

      Thank you both (jdtoronto and BrowserUK).

      I'd like to look into everything but there is so much to learn and I'm kind of all over the place. I've read about 1/3 of Programming Perl, the first 3 chapters of Mastering Regular Expressions, I've got the Perl Pocket Reference which I use all the time and I've looked at a handful of examples in the Perl Cookbook. I do very, very little Perl programming at work. I wrote a few programs and that's it. I do mainly C++ and SQL professionally. I am very interested in Perl and would like to learn a lot more about it. That's where I am.

      I've been thinking about picking up the Perl/Tk book to add to my collection of unfinished books. The idea of the GUI being portable across many platforms is great and I imagine this is where most of the GUI development will go.

      I do use Windows exclusively and have been for years. There are things in the Windows GUI that are Windows specific like the System Tray. There are also non GUI Windows specific things like Services that would be neat to exploit using Perl.

      So what I'd really like right now is to learn about all (or as much as possible) Windows stuff I can do using Perl. That is, I don't want to write my own libs or dlls in another language like C++. I want to use what is built into Perl or packages that have extended the language. That being said, I don't want to learn ALL packages because they are infinite (in theory). I want to lean the ones that have become "somewhat standard" by the Perl community. On that note, when I go to CPAN, how do I even know which packages are "somewhat standard".


      Thank you for your time and patience.

      Hi I'm Alex (alex_public@hotmail.com) I couldn't find another way to reach you. I read your answer to the topic and liked very much your accuracy... I'm deciding on what to use to build a web application, Perl or PHP? What can you say about performance of both? when using Apache/Mysql in a Win2000 server (intranet) with 20 users (Win200o or XP), and intensive I/O requests. I'd appreciate very much your comments. Alex

        Sorry Alex, I afraid I'm not a WebApps guy.

        I've never used PHP, and the little bits of playing I've done with Apache and MySQL would just about qualify me to dust the manuals of these large and complex beasts.

        If you have questions regarding WebApps and which language to use, you'll need to be somewhat more specific about the type of webapp you are going to code and ask the question as a top level SoPW. That way you will get the benefit of the (probably 100s of) years of accumulated experience of the many monks here who do this for a living and have done so for many years.

        If you give an accurate enough description of your application, you'll even find that if it is such that it would be better suited to being written in PHP rather than Perl, there are several Monks who will be prepared to stand up and say so, despite the obvious predaliction of the majority here towards Perl:)

        My own experience of WebApps is a) from a few years ago. b) were written in a secure intranet environment rather than an insecure internet facing position -- which is a very important distinction. c) Were written for an "all MS" shop, and were therefore IIS/SQL Server based.


        Examine what is said, not who speaks.
        "Efficiency is intelligent laziness." -David Dunham
        "When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller
        If I understand your problem, I can solve it! Of course, the same can be said for you.

Re: Windows programming
by jdtoronto (Prior) on Sep 30, 2003 at 15:11 UTC
    Yes, Learning Perl on Win32 is getting a little dated. I would generally suggest Learning Perl and Programming Perl - the newer Perl releases are generally basically identical on Win32 and *nix. The newer editions of the books also tend to be more Win32 friendly.

    I have the Win32 book, but never look at it these days.

    GUI programming tends to be done using Perl/Tk - there is a reasonable book - Mastering Perl/Tk - also from O'Reilly. Tk is very portable, I have clients using the same code on Win32, Linux, FreeBSD, HP-UX and Mac. Prima is another GUI toolkit and I will be giving it a try very soon. Likewise there is WxPerl which is new but worth a look.

    Prowel around the Masontery here, look in the Tutorials in particular and become familiar with SUper Search. YOu will find lots of wonderful info here.

    jdtoronto

Re: Windows programming
by jplindstrom (Monsignor) on Sep 30, 2003 at 22:33 UTC
Re: Windows programming
by WhiteBird (Hermit) on Oct 01, 2003 at 13:07 UTC
    Check out Dave Roth. I have found both his books to be useful additions to my Windows/Perl library.
Re: Windows programming
by Anonymous Monk on Oct 01, 2003 at 16:58 UTC
    Thanks WhiteBird & jplindstrom those seem like excellent sources!