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

Actually 2 questions! First, I am having some trouble installing the Term::Readkey module on my Windows 2000 machine. When I run the makefile.pl, I get the message:
Error: Unable to locate installed Perl libraries or Perl source code.
(You get this message, because MakeMaker could not find "C:\perl\5.00502\lib\MSWin32-x86\CORE\perl.h")
I'm not surprised that it can't find perl.h there, because it is actually located at:
C:\ent\appl\prod\perl\5.00502\lib\MSWin32-x86\CORE\perl.h
Is there a way to tell MakeMaker where to look?

Second, once I download a module, is there a way to make a script that uses the module portable to a machine that doesn't have the module installed? Can I just copy the module files with the script? Thanks for your help

Replies are listed 'Best First'.
Re: CPAN Modules question
by Tanktalus (Canon) on Jan 27, 2005 at 00:16 UTC

    Most likely, you've moved perl since installing it - which is a big no-no. Check c:\ent\appl\prod\perl\5.00502\lib to find a file named 'Config.pm'. It'll have the old paths - you should be able to update the 2-3 occurances of the wrong path with the correct path.

    As to your second question, yes there is a way, but I would suggest that this is somewhat reserved for advanced users since it's too easy to do it wrong. I'm sure someone will tell you how, but I'll tell you now that it's not completely obvious to a casual perl programmer. Simply copying the module files with the script only works for pure-perl modules, which Term::ReadKey is not.

    A better solution, IMO, especially for modules that use Build.PL rather than Makefile.PL, is to build the modules on a machine with a compiler, and then zip the pre-built directory up, and then install it on the target machine. For Makefile.PL-based modules, you still need nmake, though, on the destination machine, and I'm not sure if that is part of a Windows environment or not without a compiler installed.

Re: CPAN Modules question
by PodMaster (Abbot) on Jan 27, 2005 at 05:15 UTC