Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Distributing or Sharing Perl Scripts

by svsingh (Priest)
on May 22, 2003 at 20:55 UTC ( #260225=perlquestion: print w/replies, xml ) Need Help??

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

I just wrote a handy Perl script to help me with a current project at work. My manager thinks it's useful and would like me to post it for the rest of the team to use. I'm trying to think of a good and simple way to do this.

My issues are:

  • I'd rather not require team members download and install Perl just to run my work.
  • The problem doesn't lend itself to a web-based (or other client-server) solution.
  • For maintenance and simplicity, I'd like to keep the solution in Perl.
  • We're in a Windows environment (no UNIX machines anywhere).

Does anyone know of any options? I've read some posts about perl2exe, but no one seems happy with it. Right now, the best option I can think of is to just include a note with a link to ActiveState and my e-mail address for anyone who wants help setting things up.

Thank you.

Replies are listed 'Best First'.
Re: Distributing or Sharing Perl Scripts
by Mr. Muskrat (Canon) on May 22, 2003 at 21:14 UTC
    I'd say that you have several options but the best would probably be to use PAR (the Perl Archive Toolkit). Other options include PerlApp from ActiveState, perl2exe (ack!) and well, you can search for the rest or wait for the replies to come rolling in. ;-)
      Thanks Muskrat. I should also mention that asking the company to purchase anything is probably not going to fly. Not that my li'l script isn't worth it, but... well, you know how it is. Free solutions are preferred. :)
      I encountered the same problem, and used PAR. The problem is: it doesn't work when I run my script twice at the same time. Is there any option I can use that will solve this problem? Thanks
Re: Distributing or Sharing Perl Scripts
by arthas (Hermit) on May 22, 2003 at 21:17 UTC
    I collected some pretty positive comments on ActiveState's PerlApp, which compiles Perl scripts into stand-alone executables.

    Anyhow, having your team members install Perl on their system is not a bad idea... it could always be useful. ;-)


      the -f option of PerlApp, which generates freestanding executables that do not require a perl installation on the client machine, requires a lisence if I'm understanding it correctly.

      But you can always go without the -f and install ActiveState's perl on the machines that want to use it, which gives small executable files.

      He who asks will be a fool for five minutes, but he who doesn't ask will remain a fool for life.

      Chady |
        PerlApp is only $195. And as clarification, if I'm not being too pedantic, it only requires that you have the license to compile the executable, not that you have licenses for the running the binary on a client.

        If you just save a few hours of your own time, or the time of those who are going to be using the binaries (and hence don't have to install Perl) it would be worth the price of admission.

        I've used it to develop on my preferred platform (Linux), then compile for Windows users, and can attest it works splendidly even for sophisticated scripts which use dozens of modules. Even using Tk to produce (not hugely complex but decidedly nontrivial) GUIs was posed nary a problem.

Re: Distributing or Sharing Perl Scripts
by krujos (Curate) on May 22, 2003 at 21:30 UTC
    You can give perlbin a shot. I also suggest floppies buy the water cooler as a distribution mechanism.
Re: Distributing or Sharing Perl Scripts
by svsingh (Priest) on May 22, 2003 at 23:39 UTC
    I tried Muskrat's solution of PAR (particularly the pp packager). It works! Note that the installation process is a bit of a bear and the executable files are big (800k exe for a 2k script) if you're going to try something like this on your own.

    Thanks again Muskrat.

      One thing about PAR is that you still have to put perl58.dll on each machine (assuming you are using the most recent version of ActivePerl). It can be in the same directory as the exe file. I also know that it can be UPX-ed down to about 360k vs 750k. Unfortunately UPX doesn't work on the exe file created by PAR



Re: Distributing or Sharing Perl Scripts
by porkpilot (Deacon) on May 23, 2003 at 08:02 UTC
    I like the option you suggest yourself, svsingh.

    Not only does this accomplish the desired result of sharing the script among your team, it has the secondary effect of leaving team members with a functional Perl environment. So, perhaps a couple people will think "Hey, this is neat would be better if..." and then start coding. Or maybe they think of another CUFP and get started that way--this is how I got started with Perl.

    With any luck, since your manager feels the script is useful and wants you to share it, (s)he will also be understanding if you spend a little time helping get everyone up and running. Here we have the added benefit that both you and the people you help will learn something useful. (I recently wrote a script for a friend and, in the process of getting his machines set up to run Perl and the requisite mods, we both learned a lot and had a good time.)

    ++ to you!

Re: Distributing or Sharing Perl Scripts
by eyepopslikeamosquito (Bishop) on May 23, 2003 at 08:34 UTC

    A simple way to do it is to twist your Windows Sys Admin's arm very hard; tell him to organise for every workstation in the organisation to have the same K: network drive (say) mapped and to ensure that Perl is installed on this drive and is on everyone's path; this ensures that everyone is running the same version of Perl and with the same CPAN modules too. Further ensure that a local utilities directory on K: is also on everyone's path. That done, sharing your utilities is as simple as copying them to the utilities directory. This technique has worked very well for me and not only for Perl; I can walk to any workstation in the organisation and have all my favourite tools available to me: Perl, utilities, and so on.

Re: Distributing or Sharing Perl Scripts
by hangmanto (Monk) on May 23, 2003 at 04:26 UTC
    Another option would be to place your script on a box running Windows 2000 or later. The users could use terminal services to log on and run the script.

    This would cut down on the different versions that are floating around.

    Of course, you would still want to encourage everyone to download perl and start coding!

Re: Distributing or Sharing Perl Scripts
by jplindstrom (Monsignor) on May 23, 2003 at 12:11 UTC
    The trusted solution is to use PerlApp or perl2exe.

    The freestanding option of PerlApp works wonderfully for letting my coworkers use the many, many useful scripts Perl let me create for myself. PerlApp and perl2exe cost dineros though, and you said that wasn't an option. However, I think both have 30 days trial, so if you can show your boss how well it works, and how useful your stuff is, maybe...

    Use PAR if you can get it to work. I've heard it was a little trouble getting it to work properly on Windows, but that may have been solved by now, so it's probably worth an hour to experiment with it.

    If there's data files and stuff, package it with e.g. Inno Setup, an excellent free installer. It looks professional, like any other Windows program your colleagues install.

    If you want to slap a GUI on top of it, consider Win32::GUI to complete the illusion that it's Just Another Windows Program.

    These kinds of thing makes a surprising difference for the acceptance of Perl among people who aren't technically inclined. WYSIWYG. First impressions last. Image is everything. Etc.


      Personally, I'm a fan of IndigoSTAR's perl2exe when developing code for a Win32 machine, and use it to create both command line and GUI apps. PerlApp may be better, but I've never used it (anyone know of other Perl compilers?). The basic version of perl2exe is cheap enough at something like $45, but the full enterprise version hugely expensive (somewhere in the $400 range if I remember correctly). My largest app to date is some 500K+ plus a few modules that probably bring the code up to somewhere around to 600 700K. This compiles into a single 3Meg self-contained executable and ***No dependency DLLs like VB***. You can make the code smaller by making your code dependant on the PerlCRT DLL (normally compiled into the executable), but you only save about 700k. If compiling a bunch of apps for one machine, then it would be worth the effort to split the DLL off. Most of the other small stuff I compile starts at about 700K or so and goes up to about 1Meg or so. The more expensive versions of the perl2exe can get your code still smaller, by how much I'm not sure. No matter what version of compiler you end up using, it seems like it would be better than setting up an networked install of Perl. I'd share out a spare Perl machine using VNC before resorted to that.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://260225]
Approved by talexb
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2021-05-13 04:24 GMT
Find Nodes?
    Voting Booth?
    Perl 7 will be out ...

    Results (134 votes). Check out past polls.