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

Hi monks

I am trying to install modules using cpan and cpanm on Straberryperl without success. I tried both the 32 as well as the 64 versions, both 5.24 and 5.22. The reason why I try to use the portable version is that I already have a ActiveState installation for productive tasks and I do not want to mess up with multiple installations on my PC (being the nice Perlbrew not available for Windows) and I do not loke complicated solutions to have parallel Perl install (at least I have not found any easy one). I tried with "force" too. The error I get is:

Configuring Tk-804.033 ... OK Building and testing Tk-804.033 ... FAIL ! Installing Tk failed. Retry ith --force to force install it

Any idea?

Replies are listed 'Best First'.
Re: Strawberryperl (Portable) impossible install module (perlbrew for Windows!)
by stevieb (Canon) on Jun 18, 2016 at 11:06 UTC
    "being the nice Perlbrew not available for Windows"

    It sure is! (Well, it's a perlbrew equivalent written in C#). My forked version of berrybrew has improvements and additional features over the original written by David Farrell, and can be fetched via git, or downloaded as a zip archive.

    See "update2" below. You may need to do some fiddling with path to make it play nice with ActiveState, but I'd honestly recommend removing ActiveState first.

    update: I did send in PRs to the original berrybrew, but the new maintainer felt that my C# coding style wasn't acceptable enough, and unfortunately, didn't attempt to modify my needed changes for inclusion, so I created my own fork. I'm not a C# dev, and needed specific features...(--with flag for exec, much better PATH env var management in subshells, adding/removing perls available without having to recompile etc)

    update2: Just added an 'off' feature which disables berrybrew perls. This allows you to use berrybrew alongside system installed Strawberry and/or ActiveState perls without any issues or conflicts.

      That is good news! I've read on github, but I havent't find any mention of the command "off" which is used with Perlbrew to return to the "original" Perl installation (the one in PATH). On my OSX I use this to switch from the ActiveState installation to all the other installations downloaded and managed with Perlbrew.

        Update: The "off" feature described in this node is now completed per Re^2: Strawberryperl (Portable) impossible install module.

        I've opened an issue to add this command, and try to get it included over the next week :) This one should be pretty trivial. The unfortunate thing about Windows is that one needs to open a brand new shell to get PATH env var reset; you can't change it on the fly. But still, I can get that included without much hassle (essentially, it's just removing the path to berrybrew from PATH).

        If you want to be notified when the change is complete, you can subscribe to the issue here.

        update: I've actually got some time this morning before I have to run out, so I'll create a new branch and see how quickly I can get this feature added. I'll post back here if I can include it today, otherwise just watch the ticket.

        Just saw your update. Wenn, removing Activestate... that is what I'm trying to avoid using Strawberry Portable...

Re: Strawberryperl (Portable) impossible install module
by VinsWorldcom (Prior) on Jun 19, 2016 at 00:05 UTC
Re: Strawberryperl (Portable) impossible install module
by Anonymous Monk on Jun 18, 2016 at 12:46 UTC

    Problem found. From the Read file:

    Note: choose a directory name without spaces and non us-ascii charac +ters

    I just named my folder Perl 5.24.1 - That space!

      Glad you sorted the issue. FYI, the "off" feature has been added to berrybrew, and have done some minimal successful testing on a few Windows boxes.

      If you have a previous install of Perl, we'll override it with "switch", but then the original version takes back over when you run "berrybrew off". Note that you have to open a new cmd window after you run "off" before it takes effect (thanks to Windows inability to set PATH in the current shell).

Re: Strawberryperl (Portable) impossible install module
by Cow1337killr (Monk) on Jun 21, 2016 at 21:51 UTC

    You can try Sandboxie since you indicated that you are using Windows.

    I use it to experiment with installing various modules from CPAN and testing them.

    If the installs get messy, I just remove the Sandbox and can try again. My current Strawberry Perl install is not affected.

    I am trying to get the courage to do this in a sandbox:

    Remove my current version of Strawberry Perl using Add/Remove Programs.

    (Running "control appwiz.cpl" from the Windows Run window is giving me problems, though.)

    Build the latest version of Strawberry Perl in the sandbox.

    If I am pleased with the the results of a batch of installs of modules from CPAN, then repeat the process in the live Windows environment.

    UPDATE:

    I have been experiencing problems with the sandbox. For example, create a sandbox and run:

    perl -MCPAN -e shell test Test::Trap quit<<<<<<======That is how you exit the shell.

    Those errors should not occur in your live Strawberry environment.

    They seem to be associated with the use of temporary files.

    Otherwise, the sandbox has been working well for me.

    My advice: If you are a Windows user, try installing Sandboxie. It is easy to use and even if you don't have a use for it now, you will surely come up with one soon.

      You can do this with berrybrew:

      Say your system Strawberry Perl is v5.22.1 64-bit:

      > berrybrew install 5.22.1_64 > berrybrew switch 5.22.1_64 ... open new cmd window... > cpanm Module::One Module::Two Module::Ten

      Did it fail?

      > berrybrew remove 5.22.1_64 > berrybrew install 5.22.1_64 > berrybrew switch 5.22.1_64 ... open new cmd

      ...or did it work?

      > berrybrew off ... new cmd window will now use system perl again > cpanm ...

        Oh. So when a fellow Perl monk says they are experiencing a particular problem and they are running a particular version of Strawberry, then one can attempt to duplicate the problem on one's own computer system on possibly the other side of the world.

        Impressive.