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

I just installed Strawberry Perl v5.22 over an existing installation and I get the following error message:
Perl lib version (5.18.1) doesn't match executable...

Now, nothing works (e.g., perl programs, CPAN, etc). Without CPAN, I don't know how to update the library. I have searched the web and I can't seem to find a solution.

I am running Win7 service pack 1.

Any help would be much appreciated.

Thanks,

EigenFunctions
Win7 x64 service pack 1

Replies are listed 'Best First'.
Re: Strawberry Perl, from 5.18 to 5.22
by afoken (Chancellor) on Jul 23, 2015 at 18:15 UTC
    I just installed Strawberry Perl v5.22 over an existing installation

    And now you have a directory tree with a wild mix of 5.18.1 and 5.22 modules. That can't work.

    Revert to the clean 5.18.1 state (i.e. delete the directory tree, then restore it from your backup), export a list of all modules using cpan's autobundle command, uninstall perl 5.18.

    Only then, install 5.22. After that, use cpan to install all modules listed in the Bundle::Snapshot_* generated by the 5.18.1 autobundle command.

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

      Where does the installation store the backup?

      The ability to install all the modules I've installed is a good one as I don't know all the modules I've installed over the past years.

      BTW -- There is only one folder for perl, namely "c:\strawberry". The windoz path variable has the correct folder. I looked in the env vars and there is nothing there except the path. I noticed in control panel that there are two programs listed (the old and the new). I don't want to uninstall the old as I will probably lose my installed modules.

      Thanks,

      EigenFunctions
      Win7 x64 Service Pack 1

        Where does the installation store the backup?

        I never said that the installation would create a backup. You should have a backup of your computers' data. If not, the data on your computer can't be important for you.

        I don't know all the modules I've installed over the past years

        The cpan tool does. Issuing the autobundle command will create a list that can be parsed by cpan.

        BTW -- There is only one folder for perl, namely "c:\strawberry". The windoz path variable has the correct folder. I looked in the env vars and there is nothing there except the path. I noticed in control panel that there are two programs listed (the old and the new).

        Yes, as I wrote before: You have completely messed up your Strawberry Perl installation. Use your existing backup, restore to the point before you installed 5.22. Then continue as I wrote before.

        I don't want to uninstall the old as I will probably lose my installed modules.

        That's why people make backups.


        I think there is a way that could work without a backup of 5.18.1. Make a backup of the current state before trying it, because I may be wrong, and following this UNTESTED procedure may make things even worse.

        1. Search the file perllocal.pod, it contains a list of all installed packages.
        2. Look at the contents. Maybe 5.22 has overwritten it, in that case, it would be quite short and does not contain your manually installed modules.
        3. If perllocal.pod looks good (i.e. is from 5.18.1), copy it somewhere else.
        4. Uninstall 5.22 from control panel. This will (hopefully) delete all files that 5.22 installed, both new ones and updated ones. But it should not uninstall modules that did not come with 5.22. So you will end with a 5.18.1 that lacks most of its files, but with your extra 5.18.1 modules intact.
        5. Install 5.18.1 from the original installer file. If the installer offers to repair the installation, go the repair way. If not, just install it. This will add the missing files.
        6. If the installer refuses to install, you need some extra steps:
          1. Make a copy of the entire strawberry directory tree.
          2. Uninstall 5.18.1 from control panel.
          3. Install 5.18.1 from the original installer file.
          4. Copy the copy of the old strawberry directory tree back over the current strawberry directory, overwriting any existing files.

        Now, you should have a working 5.18.1 installation.

        1. Use the cpan tool's autobundle command to create a snapshot, copy Bundle::Snapshot_*, look at it and search for some modules that you installed manually.
        2. If your modules are missing, maybe the perllocal.pod copy from the first is still intact. Make a list of modules you have to install in 5.22.
        3. If perllocal.pod was overwritten by 5.22, you are less lucky. Browse c:\strawberry\perl\site\lib to find what modules are currently there. Make a list of modules you have to install in 5.22.
        4. Uninstall 5.18.1 from the control panel, and delete the remaining strawberry directory tree.
        5. Install 5.22.
        6. Run the cpan tool and, if autobundle listed all of your modules, install Bundle::Snapshot_*. If not, go through your list of modules to be installed.
        7. MAKE A BACKUP!

        Alexander

        --
        Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
        The installer does not store or make a back-up. No doubt you have done so yourself. ;)

        If not, try if the autobundle function from cpan still works. If it works, use it and save the resulting file somewhere safe.

        Then uninstall Perl totally. If necessary you can simply delete your c:/strawberry folder, but make sure it does not contain non-cpan modules (i.e. modules you have written yourself).

        Then install Strawberry Perl again. You can do that anywhere you want if you use the *.zip version rather than the *.msi version.

        Once that is done, you can use the autobundle file to reinstall your set of modules.

        CountZero

        A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

        My blog: Imperial Deltronics
Re: Strawberry Perl, from 5.18 to 5.22
by ww (Archbishop) on Jul 23, 2015 at 17:59 UTC
    1. How did you install?
    2. Have you checked Win's $PATH?
    3. Have to checked whether the install actually made a proper changes to your previous path?
    4. Did the install actually create an appropriate lib?

    Your error message appears to tell you that Strawberry 5.22 went looking for it's various core modules and only found the lib for whatever Perl 5.18.1 you had previously.

      1. I used the MSI package on the Strawberry Perl website
      2. The windoz path var points to the correct place (the only place "c:\strawberry")
      3. Path looks OK
      4. How do I tell if the lib is correct? Some file dates show up as today. Where is the lib version number stored? Can I just change it?

      I don't want to have to reinstall all the modules I've added over the years (at least since 2013). How do I install (reinstall or upgrade) the entire library w/o cpan (which now won't work)?

      Thanks,

      EigenFunctions
      Win7 x64 Service Pack 1

Re: Strawberry Perl, from 5.18 to 5.22
by VinsWorldcom (Prior) on Jul 23, 2015 at 20:08 UTC

    I use the ZIP file to install and just UNZIP into a directory - C:\Program Files\strawberry\strawberry_5.MJ.MN-MSWin32-x64-multithread.

    The MJ and MN are the major, minor version numbers. This way I have all versions of Perl in one place and then use 'mklink' in a fancy script (see below) to map C:\strawberry to the version I want to use. It's basically PerlBrew for Strawberry on Windows.

    By doing it this way, I never have to change my PATH, which just includes:

    C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawrry\perl\bin;

    Batch script for changing Perl versions 'plroot.bat':

    @echo off setlocal ENABLEDELAYEDEXPANSION set PLPERL=strawberry set PLROOT=%SystemDrive%\!PLPERL! set PLUSER=%USERPROFILE%\perl set PLSTOR=%ProgramFiles%\!PLPERL! REM set PLSTOR=%SystemDrive% REM REM Help REM if {%1}=={/?} goto HELP if {%1}=={--help} goto HELP REM REM Check args REM if not {%2}=={} goto ERROR REM ------------------------------------------------------- perl -v 2>nul>nul if ERRORLEVEL 9009 goto ERROR_INSTALL :NORMAL if {%1}=={} ( dir /al !PLROOT!* 2>nul | find "JUNCTION" > nul if ERRORLEVEL 1 goto INSTALL for /f "tokens=5,*" %%i in ('dir /al !PLROOT!* ^| find "JUNCTION"' +) do @echo !PLROOT! %%j for /f "tokens=5,*" %%i in ('dir /al !PLUSER!* ^| find "JUNCTION"' +) do @echo !PLUSER! %%j echo. perl -e "print \"$] \@ $^^X\n\"" echo. echo Available: for /f "tokens=1,* delims=_" %%i in ('dir /b "!PLSTOR!\!PLPERL!_*" +') do @if exist "!PLSTOR!\!PLPERL!_%%j\perl\bin\perl.exe" echo %% +j ) else ( if exist "!PLSTOR!\!PLPERL!_%1\perl\bin\perl.exe" ( if exist !PLROOT! rmdir !PLROOT! mklink /j !PLROOT! "!PLSTOR!\!PLPERL!_%1" if not exist %userprofile%\perl5\%1 ( mkdir %userprofile%\perl5\%1 ) rmdir !PLUSER! mklink /j !PLUSER! !userprofile!\perl5\%1 echo. perl -e "print \"$] \@ $^^X\n\"" ) else goto ERROR ) goto END :INSTALL echo Installing... pause if not exist %PLROOT% goto ERROR_NOTFOUND for /f %%i in ('perl -MConfig -e "print \"$Config{version}-$Config{arc +hname}\""') do set PERLJUNCDIR=%%i if not exist "%PLSTOR%" mkdir "%PLSTOR%" move %PLROOT% "%PLSTOR%\%PLPERL%_%PERLJUNCDIR%" call :NORMAL %PERLJUNCDIR% goto END REM ------------------------------------------------------- :ERROR echo %0: Parameter format not correct goto END :ERROR_INSTALL echo %0: Perl not installed goto END :ERROR_NOTFOUND echo %0: Perl not found goto END :HELP echo. echo %0 manages different versions of Perl. echo. echo USAGE: echo. echo %0 ^<Perl_version_number^> echo. echo Where ^<Perl_version_number^> is one of the following: echo. for /f "tokens=1,* delims=_" %%i in ('dir /b "!PLSTOR!\!PLPERL!_*"') d +o @if exist "!PLSTOR!\!PLPERL!_%%j\perl\bin\perl.exe" echo %%j echo. :END

      Thanks to everyone for the suggestions. Right now I'm not sure how I'm going to recover from this debacle. So far, it has cost me nearly a days worth of wasted time at work and at best, that's disappointing. I'm hoping it won't take another day (or more) to get back to where I was this morning. I actually do have a list of installed modules that I think I can use, maybe.

      Having said all I did about Perl in past posts, it remains a vital part of my Engineering toolbox that I use and need for everyday activities.

      Long live Perl!

      Thanks,

      EigenFunctions
      Win7 x64 Service Pack 1

        From Re^4: Strawberry Perl, from 5.18 to 5.22:

        Backing up the over 31k files and 1GB of space is NOT the answer for a standard installation. I have hundreds of applications installed and most of them don't need to be backed-up. Data needs to be backed-up, not static applications.

        and

        Perl is (was) a wonderful platform, but it has been going downhill at a rapid pace. Strawberry Perl is a good example of the decline.

        From Re^2: Strawberry Perl, from 5.18 to 5.22:

        Right now I'm not sure how I'm going to recover from this debacle. So far, it has cost me nearly a days worth of wasted time at work and at best, that's disappointing. I'm hoping it won't take another day (or more) to get back to where I was this morning.

        So, you did not have a backup of your computer, and now it takes you far more time than expected to recover. And that's Perl's fault?

        Really?

        As I said before: If you don't have a backup of your computer's files, those files can't be important.

        Here is what would have happened with a working backup:

        1. Install 5.22 over 5.18.1
        2. Notice that this was a bad idea
        3. Uninstall 5.22
        4. deltree /y c:\strawberry
        5. Start backup software
        6. Restore c:\strawberry from yesterday's backup
        7. Ask perlmonks how to upgrade strawberry without damaging or loosing all modules

        Total time: about 1 hour, and 5.18.1 still working.


        Quoting again Re^4: Strawberry Perl, from 5.18 to 5.22:

        Data needs to be backed-up, not static applications.

        Yes, this is correct. Static applications that can be reinstalled from some installation media, archive or setup program and just work after that don't need a backup. But of course, you should have a backup of the installation media / archive / setup program. Good examples for such an application are calculator, notepad and clock that came with Windows. All without relevant configuration, available on the CD/DVD, and all without data.

        Office does not fit, it is not static, because it has a lot of configuration settings, parts in the registry, parts in local files (normal.dot). So you should backup Office.

        Perl also does not fit, it is also not static. It adds files to its installation as soon as you install a module.

        Now you have two options: Decide for each and every application, or worse, for each and every file if it is worth to be backed up. Or just backup the entire computer, wasting a few Megabytes of backup space for applications that could also be restored from installation media.

        With the second option, you can simply restore anything you damaged from backup, no matter if the damaged applications are also present on installation media or not. With the first option, you will find that your backup is incomplete, you have to search for the installation media, and you have to reinstall the damaged applications after restoring from the backup.

        An external 4 TB USB 3.0 harddisk costs less than 120 €. It has more than enough space to store several full backups of a common desktop. With incremental backups, you usually don't have to think about disk space at all. 6 TB costs about 250 €, if your desktop has a lot of data. 12 TB costs less than 600 €, if you collect huge amounts of data on your desktop.

        Compare those prices with the cost of two days of work.

        Your computer can do backups automatically, you don't have to monitor it. It can do incremental backups, so only the first backup will take a long time and use a lot of disk space. The following backups just save your changes, this is fast and uses only a little bit of disk space.


        Yes, the Strawberry 5.22 installer should not have damaged the existing 5.18.1 installation. It should have refused to install over 5.18.1, and instead give you instructions how to upgrade.

        Alexander

        --
        Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)