Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Copying Perl installation between computers

by perldough (Sexton)
on May 30, 2012 at 17:23 UTC ( #973342=perlquestion: print w/replies, xml ) Need Help??
perldough has asked for the wisdom of the Perl Monks concerning the following question:


I am new to Perl, new to these forums, but an old-time programmer at heart.

I have just inherited a half-complete Perl project at work. The single person developing the program was using the following setup: Windows XP, installed Active Perl 5.12, and added many modules and extensions on top of that installation.

He said that he copied his C:\Perl directory to a virtual machine containing a fresh install of XP (same location in the virtual machine). He then changed the user path variable in the virtual machine to include 'C:\Perl\bin;C:\Perl\site\bin'. He then ran his program and all was fine. He suggested that I do the same.

I have done this on the work computer equipped with XP, my personal computer equipped with Vista and another virtual machine equipped with a (not so fresh) install of XP. In all of these cases, I get this nebulous error message:

Can't locate version/ in @INC (@INC contains: C:/Perl/site/lib/M +SWin32-x86 -multi-thread C:/Perl/site/lib C:/Perl/lib .) at (eval 53) line 2. BEGIN failed--compilation aborted at (eval 53) line 2. Compilation failed in require at C:/Perl/site/lib/PDL/IO/ li +ne 315. BEGIN failed--compilation aborted at C:/Perl/site/lib/PDL/IO/FastRaw.p +m line 315 . Compilation failed in require at line 271. BEGIN failed--compilation aborted at line 271.

If anyone has any ideas, I would greatly appreciate it.

Thanks in advance,

Replies are listed 'Best First'.
Re: Copying Perl installation between computers
by VinsWorldcom (Parson) on May 30, 2012 at 18:39 UTC

    This is highly irregular and you should install Perl correctly, not by simply copying the directory tree.

    That said, the error message says it can't find the module version::vpp (version/ in your @INC variable.

    • Did you copy the installation directory (and all subdirectories) to your new computer at C:\ - that is - C:\Perl\...?
    • Did you add the C:\Perl\site\bin and C:\Perl\bin paths to your PATH variable (order matters)?
    • UPDATE: Do all the directories in @INC exist? Execute:
      perl -e "print \"$_\n\"for @INC"
      from the Command Prompt and ensure the directories reported exist.

      Thank you all for your replies!

      -I recursively copied C:\Perl on the old system to C:\ on the new systems. As a result, I have a C:\Perl directory on each of the new systems.
      -I did not always put them in the order you mentioned, but I played with that later and found no difference in outcome.
      -Having executed the line of code your provided, I obtained the following output:

      C:/Perl/site/lib/MSWin32-x86-multi-thread C:/Perl/site/lib C:/Perl/lib .

      All of these directories exist.

      -It turns out that there are many's, but never in a directory named "version".
      -The code you provided gives the following error: "Can't load 'C:\Perl\site\lib\auto\version\vxs\vxs.dll' for module version::vxs: load_file:%1 is not a valid Win32 application at C:\Perl\ line 201."
      -I'm sure that Perl was never installed on the XP virtual machine, at the very least.


        So the message I was after was in fact a bit misleading. The DLL could not be loaded as I expected, but not because it would be invalid, but rather because it depended on some missing libraries. One tool that's great for such things is the Dependency Walker. It'd tell you whether the DLL is corrupted or missing dependencies. It doesn't know where to get the missing DLLs, but at least it tells you the dependencies are the problem and the names of the DLLs.

        P.S.: If you reply to my post, I get notified.

        Enoch was right!
        Enjoy the last years of Rome.

Re: Copying Perl installation between computers
by Jenda (Abbot) on May 30, 2012 at 21:52 UTC

    Can you find a file named "" in a directory named "version" anywhere in the original XPs? It looks like version::vpp is the pure Perl version of the module that's used if the version::vxs cannot be loaded. What does

    perl -e "use version::vxs; print 'Hello'"
    do? Does it print an error or "Hello"? If an error, what's the error? Any chance you have two perls installed and the one you started tries to use the modules of the other? Or maybe you overwrote one installation with the other?

    Enoch was right!
    Enjoy the last years of Rome.

Re: Copying Perl installation between computers
by exilepanda (Pilgrim) on May 31, 2012 at 03:00 UTC
    From you Perl path, I guess your original copy was an Active Perl. Thus, a side note for you with my experience is that, if you copy an installed Perl from WinXP to Vista(or 7). This won't work properly. But the way you porting a Perl from XP to XP should be OK.

    I didn't have time to figure out why is that, but things going fine after I installed Strawberry Perl, an of cause download the modules again accordingly. Also, there are lot of problems using Active Perl in Vista(or 7) though (eg. ppm won't work )

Re: Copying Perl installation between computers
by perldough (Sexton) on May 31, 2012 at 14:25 UTC

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2017-03-25 16:57 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (311 votes). Check out past polls.