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

I'm having problem using CPAN on a new ActiveState installation on Win7 (x86). I tried c>ppm and search for Imager finds nothing. Perl -MCPAN 'install Imager' says it cannot run install. I did this all years ago on another system. What am I doing wrong now?

Replies are listed 'Best First'.
Re: Using CPAN
by tobyink (Canon) on Dec 01, 2013 at 10:08 UTC

    Try:

    perl -MCPAN -e'install Imager'

    The -e flag tells perl that the string 'install Imager' should be executed as Perl code. Without it, perl assumes that there is a file called 'install Imager' and tries to open that file and execute any Perl it finds within it.

    use Moops; class Cow :rw { has name => (default => 'Ermintrude') }; say Cow->new->name
      :D
      $ perl -MCPAN -e 'install Imager' Can't find string terminator "'" anywhere before EOF at -e line 1.

      win32 cmd.exe likes the double quotes

      OTOH cpan Imager ought to work even on activeperl

Re: Using CPAN
by 2teez (Vicar) on Dec 01, 2013 at 10:35 UTC

    Or you could do from the Command Line Interface ( CLI ) like::

    perl -MCPAN -eshell
    then you enter into cpan shell and do the installation like :
     cpan[1]> install Imager

    If you tell me, I'll forget.
    If you show me, I'll remember.
    if you involve me, I'll understand.
    --- Author unknown to me

      OK. I followed your suggestion: perl -MCPAN -eshell, etc. There were a ton of errors. It seems it was using (trying to use) the WATCOM nmake.

        I then tried renaming Watcom nmake, then again MCPAN. And again, there were many errors. I tried redirecting the install Imager line (using gt sign), but it only saved the last dozen or so items.

Re: Using CPAN
by dasgar (Priest) on Dec 01, 2013 at 13:41 UTC

    Although others posts are directly addressing your current issue, I thought I'd share another piece of information that might come in handy for you down the road.

    Without any changes, ActivePerl by default will only be able to install pure Perl modules from CPAN. For any modules that need to be compiled (for example: XS modules), you need a few more steps. With 32-bit ActivePerl, use ActiveState's PPM utility to install dmake and MinGW. Once those are installed, you should be good to go and can install just about anything from CPAN.

        Got it. Am I correct that dmake is not the default make? That the makefile assumes make or nmake?