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

Is there a way using cpan from bash, or perl -MCPAN -e shell, to install modules without installing the documentation files? Thanks

Replies are listed 'Best First'.
Re: cpan install without docs
by jeffenstein (Hermit) on Dec 20, 2024 at 12:27 UTC

    If you use cpanm (App::cpanminus), there is a --no-man-pages option to omit the man pages. Nothing for the .pod documentation though.

    🐪
Re: cpan install without docs
by marto (Cardinal) on Dec 20, 2024 at 12:47 UTC

    cpanm has --no-man-pages, and is faster than cpan.

    cpanm --no-man-pages Module::Name

    Update: see also Pod::Strip.

Re: cpan install without docs
by hippo (Archbishop) on Dec 20, 2024 at 12:16 UTC

    You can use the PERL_MM_OPT environment variable to tell ExtUtils::MakeMaker not to install the man pages along these lines (untested):

    export PERL_MM_OPT='INSTALLMAN1DIR=none INSTALLMAN3DIR=none'

    There will probably be something similar available for Module::Build and other installers.

    Obviously this will not strip out the POD which is embedded in the .pm files. You would have to de-POD them yourself if that's the objective.


    🦛

      Assuming none is recognized, the equivalent would be

      export PERL_MB_OPT='--install_path bindoc=none --install_path libdoc=n +one'
      thanks! I will give it try and let you know