Passing Environment and ExtUtils::MakeMaker options to CPAN methods

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I'm trying to fully automate the installation of a long list of modules
using methods in CPAN::Shell, rather than running that shell
interactively.  For modules that require no interaction, this has been

However, there are many modules that require you to set specific
environment variables and/or pass options to ExtUtils::MakeMaker on the
command line, such as in this example for the XML::LibXML module:

cpan> look XML::LibXML
 $ XMLPREFIX=/usr/local/src/libxml2/2.6.13 \
   /full/path/to/perl Makefile.PL \
   LIBS='-L/usr/local/lib -R/usr/local/lib -L/usr/lib -lxml2 -lz -lm' \
   INC='-I/usr/local/include/libxml2 -I/usr/include'
 $ make
 $ make test
 $ make install
 $ exit

After searching for solutions to accomplishing the same result using
CPAN::Shell, Module::Install, etc, I'm still not clear on how I'd pass
this information to the CPAN::Shell->make() method, for instance.

I'm sure it would be easy to pass the environment variable indirectly
by setting $ENV prior to calling CPAN::Shell->make(), but
that still leaves the options that need to be passed to

Any pointers appreciated.

Re: Passing Environment and ExtUtils::MakeMaker options to CPAN methods

Sorry, I meant to say CPAN::Module->make() method above, not

Gordon Marler

Site Timeline