Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Multiple Versions of Perl and Multiple Users

by mmartin (Monk)
on Oct 02, 2013 at 19:27 UTC ( #1056670=perlquestion: print w/replies, xml ) Need Help??
mmartin has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks,

I recently created a Perl Gtk2 GUI program that I wanted to package together into a standalone Windows Executable.
I've been using Linux almost religiously the last few years so I was hoping someone could help me out or point me in
the right direction with this.

I'm currently using Windows XP 32-bit, and I have Strawberry Perl v5.18.0 installed. I had ActivePerl installed at first
but had lots of difficulties getting Gtk2 installed and had much better luck installing Gtk2 when I was using Strawberry Perl
instead. I had never installed Perl on Windows before this point so it could have just been a coincidence that Strawberry
worked out better.

I've also downloaded the CavaPackager program in order to package my program into a Windows executable. But when attempting
to build the project, CavaPackager throws an error because you can't use any Perl version above 5.14 with the program and
I'm currently using 5.18. I also attempted to use the Perl2Exe Command but that only supports up to Perl v5.16...

I'd like to keep Perl v5.18 on the PC and I did find posts where people said that it is possible to have more then one Perl
version installed, but if I try to run the Strawberry Perl Windows installer (*i.e. .msi file) I get an error saying
a newer version is already installed. So I'm assuming I'd have to install/compile from source, is that right?

Also, I had a thought that maybe I could create another user on the Windows XP PC and attempt to install it under that user?
Does anyone think that doing that might be easier (*if at all possible), then compiling a second version of Perl from

Any suggestions would be greatly appreciated!

Thanks in Advance,

  • Comment on Multiple Versions of Perl and Multiple Users

Replies are listed 'Best First'.
Re: Multiple Versions of Perl and Multiple Users
by Laurent_R (Canon) on Oct 02, 2013 at 21:48 UTC

    Hi, I do not know if this is gonna work for what you want to do, but Strawberry has portable versions which make it possible to have several Perl versions "installed". I have been using this possibility only for a few months (I usually run Perl on Unix, Linux or Cygwin), but I have found portable Strawberry to be quite handy when I need to try things on Windows. You might have to change your Path variable under Windows to prevent problems between different versions. Just my 2 cents worth...

Re: Multiple Versions of Perl and Multiple Users
by Anonymous Monk on Oct 03, 2013 at 00:03 UTC
Re: Multiple Versions of Perl and Multiple Users
by dasgar (Priest) on Oct 02, 2013 at 22:20 UTC

    I personally have not tried to install multiple versions/distros of Perl onto one Windows system myself, so I can't offer any suggestions on that. If I remember correctly, there are at least a few monks on this site who have done this before.

    For creating your executable, have you looked into using the pp utility from PAR::Packer?

Re: Multiple Versions of Perl and Multiple Users
by sam_bakki (Pilgrim) on Oct 03, 2013 at 11:24 UTC

    Hi Matt

    I have been developing multiple Perl+GUI tools in my company. I also faced similar issues like you when packaging for Windows. After a lots of research, Past 2 years I have been using "PerlApp" - Active State PDK. PerlAPP is a nice utility from Active State to convert perl scripts to Windows EXEs.

    I have following configuration,

    1. OS: Windows 7 x64 bit 2. Perl: Active Perl 5.16 x32 bit version, I need to create exes for x +86 & x64 beside, I have not yet got a situation to force me to move o +n x64 perl. 3. GTK2: Get Gtk2 and other essential pre built perl packages from Rep +ository: 4. Glade: Get windows version exe of Glade 3.8.1 (3.14 version is not +working good in windows) from Gtk website - This is to develop GUIs a +nd load from code. 5. That is it - You can use perl app to convert your Gtk2-perl script +to exe. 6. Note: sisyphusion's repository builds Gtk2 with using GCC Libs. So +you need include c:\Perl\site\bin\libgcc_sis_452.dll and c:\Perl\site +\bin\libgcc_x86_470.dll in perl App project as a "Bound Files" with a +uto extract on startup option. So these libs will be available to you +r exe for linking. 7. Note: You should also include any resource files, Ex: Pix map image +s / glade file as a "Bound Files" and in your code you need to extrac +t before using. 8. Have a look my perl Gtk2 project: +oft-search-spider/ , Browse for code and see how I handle perl APP bo +und files. Also there is an exe (perlApp created) , you can play with + it to see how Perl+Gtk2 exe behaves.

    Thanks & Regards,
    Bakkiaraj M
    My Perl Gtk2 technology demo project - , contributions are welcome.

      Hey Guys,

      Sorry for the delay, I had to push this off for a few days because of work, but I was able to get back to it this morning...

      So I decided to grab an old/spare laptop from work which was pretty much bare bones Windows XP Thinkpad.

      I installed Strawberry Perl v5.14 on the PC and just now finally got all the Required Modules
      for Gtk2 installed from, which all installed without any
      issues... Great site, thanks for posting that link Sam_bakki.

      At first I had all the modules installed but when I ran my Perl GUI I would get these errors, all on the same line:
      Gdk-WARNING **: gdk_win32_pixmap_new: depth = 16 not supported at myGU line 1120. Gdk-CRITICAL **: gdk_gc_new_with_values: assertion `drawable != NULL' +failed at line 1120. Gdk-CRITICAL **: gdk_gc_set_colormap: assertion `GDK_IS_GC (gc)' faile +d at line 1120.
      And the line containing the error was: (*i.e. Line 1120)
      And I couldn't figure out why the heck I was getting these errors. I also got the same error on a simple Hello
      World GUI which only contained one widget... So I decided to remove all the Modules and its dependencies
      for Gtk2. I then reinstalled them and still go the same error.

      I then noticed the error was mentioning the depth was "16", so I checked the display "Settings" tab from the
      Desktop Properties menu and noticed the colordepth was set to 16bit. So I changed it to 32-bit and now everything
      seems to be runnning PERFECTLY...!!!

      Thanks Again sam_bakki for your post about the Gtk2 Modules...

      So I think I'm going to attempt the CavaPackager program again now that I have a compatible verison of Perl installed.
      If that doesn't work, or if it gets too confusing, which could happen because it is a pretty extensive app with
      LOTS of configurables, options, etc... I'll give one of the other options a try.

      Here are the one's I know of:
      • CavaPackager
      • Perl2Exe
      • pp (*or PAR::Packer)
      • PerlApp (*Not sure, but can this ONLY be used with an ActiveState Perl installation...?)
      • perlcc

      Are there any others out there that anyone else can think of to add to this list..? I wanted to try a few and see which
      one I like best.

      Again, thanks for the replies guys, very much apprecited!


Re: Multiple Versions of Perl and Multiple Users
by mmartin (Monk) on Oct 07, 2013 at 21:28 UTC
    Hey Guys, I'm doing a reply to the OP so I can get all at once...

    Thanks everybody for the replies, much appreciated! Sorry for the delay in replying, but my company is moving to a new
    building soon and of course the IT department is in charge of basically anything with a wire or a plug, which is pretty
    much EVERYTHING..!! So we've been swamped trying to deal with that. But I've got some time so I thought I'd check in.

    Laurent_R, thanks for the reply!
    Humm.. No I haven't seen/used that before. I also am a Linux person so doing this kind of stuff on Windows can be a bit
    of a pain to say the least. But the portable version sounds like an option though. Maybe I'll look into that and see if
    I can run a supported version (*5.14 being the highest it supports) and try to have CavaPackager use that portable
    version instead.
    Thanks again for the suggestion!

    dasgar, thanks for the reply!
    No, I haven't looked into it quite as deeply as I have the CavaPackager. But I do remember reading about it and I think I
    may have even downloaded it at some point during this whole thing and just kind of forgot it was there... But I'll look at it
    again and see if Hopefully (*fingers crossed) it supports the 5.18 Perl version.
    Thanks, I'll read up on it again and see what I find.

    Anonymous Monk, thanks for the reply!
    I did download the zip'ped version of "Strawberry Perl v5.14.4.1-32bit" last week sometime and was attempting to use that
    to "compile/build" my 'project' but got errors from CavaPackager when doing so.
    I had extracted the Zip file to "C:\strawberry_v5.14\" and also already had version 5.18 installed (*using the .msi installer)
    to "C:\strawberry\". I had set the CavaPackager's global settings to point to "C:\strawberry_v5.14\perl\bin\perl.exe", but would
    get an error when running the "scan" over the project, which I think checks the Perl executable, Modules path, etc... And I would get
    these errors you see below:
    2013-10-07 16:45:03 : Error : Scan: Access is denied. 2013-10-07 16:45:03 : Error : Scan: User script failed for module Cava +::Global. Using default rule. 2013-10-07 16:45:03 : Message : Cava Packager encountered errors durin +g the scan
    Now I'm pretty sure all 3 of those are for the same thing. And I think the error is on the perl.exe file for the Perl version I extracted
    from the zip file. During this "scan" process from Cava, as I watch it run through the scan, when it hits "Scanning File: Cava::Global",
    which is where the "perl.exe" location is defined, I get another pop-up window which stops the scan until I hit 'ok', which says:
    C:\strawberry_v5.14\perl\bin\perl.exe is not a valid win32 application
    Not really sure why I'm getting this error. The File name of the Perl zip file I downloaded specifically says "32-bit" in the name so not
    sure what's going on with that error...?

    I was thinking that this error was because I need to change my PATH variable up a little bit to point to the other Perl version 5.14, instead
    of the 5.18 version? I was thinking that Windows is giving that error because that specific "perl.exe" file is not in any of the directories
    listed in the PATH variable.

    Does that sound like that could be the issue?
    If yes, and I add the directory to the PATH variable from the command prompt, the next time I reboot will it restore my "default/normal" PATH var?
    Or would that not work because it would only be that way for that one Command Prompt window, and I would need to change it from Registry in order
    to use the updated PATH Variable with a program outside THAT command prompt window..?

    Thanks Again, for the reply much appreciated!

    Hey sam_bakki, thanks for the reply!
    Cool, no I haven't read about that one before. I'll have to check it out. Maybe it would be easier for me to install my "2nd" Perl install from a
    different provider like Active State then trying to have 2 Strawberry Perl versions...

    The only other thing I've tried other then CavaPackager was the program Perl2Exe, but that one as well requires a max version of 5.16. So again
    trying to use that tool I would need a separate Perl version installed. But I'll check out the "PerlApp" from Active State and see how that works.
    If you say you've had lots of trial and error for the last 2 years building Perl+GUI Apps, and you now use that one to do your building, then maybe
    that might be my best bet.

    Thank you VERY much for posting the links and details for that. I'll check it out and post back with what I find. Do you know if that "PerlApp"
    requires a specific Perl Version in order to run?

    What I started to do over the weekend was, after getting an old spare Thinkpad we had laying around the office, with 32-bit XP installed, I started to
    install Perl v5.14, and then began installing ALL the Modules I use in my Program, which is quite a few. But I stopped after getting Gtk2 installed and
    planned on picking back up with that tonight. I figured instead of dealing with this headache I could start with a fresh PC (*i.e. one without any
    Perl on it yet)
    and one I'm not afraid of "breaking"...

    I'll post back tomorrow and let you guys know what's going on. If things go well hopefully I can just build the EXE on that laptop...

    Anyway, thanks AGAIN everybody for the replies! Very much appreciated!

    Thanks Again, Matt

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1056670]
Approved by marinersk
Front-paged by davido
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2018-04-26 18:07 GMT
Find Nodes?
    Voting Booth?