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

My perl is installed under the "Program Files" directory. Actually it came with the xampp package from Apache Friends and the actual install directory is C:\Program Files\xampp\perl\bin. When I try to install a new package using the CPAN module - I get the message : ======================================================
'C:\Program' is not recognized as an internal or external command, operable program or batch file. Running make test Make had some problems, maybe interrupted? Won't test Running make install Make had some problems, maybe interrupted? Won't install
=======================================================

I guess the problem is the space in "Program Files" - is there a way to get around this problem? Thanks.

Replies are listed 'Best First'.
Re: CPAN config problem under WIN XP
by bowei_99 (Friar) on Apr 15, 2006 at 22:58 UTC
    Yes, as you say, it sounds like your system interpreted your command as two different commands, with the space between 'Program' and 'Files'.

    • Is 'C:\Program Files\xampp\perl\bin' in your path? (Right click on my computer, properties, advanced, environment variables->System variables->path). If not, I'd suggest adding it and trying again.
    • You might also cd to C:\Program Files\xampp\perl\bin, and run perl -MCPAN -e shell.
    • Lastly, you can put the full pathname in double quotes, like "C:\Program Files\xampp\perl\bin\perl" to reference the perl binary.

    -- Burvil

Re: CPAN config problem under WIN XP
by idsfa (Vicar) on Apr 16, 2006 at 18:38 UTC

    "Program Files" is also known as "Progra~1". You can go into your CPAN config file and modify all of the former to the latter and it should work.

    (Again I wonder which genius at MicroSoft decided to make the default install location be a place the the OS cannot easily use??)


    The intelligent reader will judge for himself. Without examining the facts fully and fairly, there is no way of knowing whether vox populi is really vox dei, or merely vox asinorum. — Cyrus H. Gordon
Re: CPAN config problem under WIN XP
by m.att (Pilgrim) on Apr 16, 2006 at 16:29 UTC
    If you're using ActivePerl (available from www.activestate.com for free) you can use the 'ppm' command to install perl modules. This is usually quite a bit less painful than using CPAN.pm because you don't need a working make utility (or a compiler for some modules with XS). Some modules are not available through ppm or are outdated, but the vast majority are well maintained and working. ppm will also do the work of searching and downloading the modules you want, similar to CPAN.pm.

    You can invoke ppm with:

    "C:\Program Files\xampp\perl\bin\ppm.bat"

    Once you get to the ppm> prompt, you can enter 'help' for online help.

    Some common ppm commands are:

    search Module::Name (Find a module)

    install Module::Name (Install a module)

    uninstall Module::Name (Uninstall a module)

    You can also avoid the ppm shell by entering commands after the ppm argument, such as:

    "C:\Program Files\xampp\perl\bin\ppm.bat" install Module::Name

    As suggested in a previous post, adding the Perl bin directory to your PATH environment variable will also make the process of invoking ppm significantly less annoying as well.

    Good Luck,

    m.att