Is there a way to configure the default mirror for App :: cpanminus (cpanm)?

I know that you can easily configure cpan to use a specific mirror. However, I recently started using cpanm on the advice of a friend, and I cannot find a way to set the default mirror without specifying --mirror http://cpan.metacpan.org on the command line every time.

Is there an environment variable or configuration file that I can set a default mirror for?

As for why I would like to just not use the list of default mirrors, I am FI and we are without a firewall. Only one mirror is allowed through our firewall.

+5
source share
1 answer

Quote cpanm docs

ENVIRONMENTAL VARIABLES

PERL_CPANM_OPT If set, adds a set of default parameters for each cpanm command. These parameters are included first and therefore command line parameters are redefined.

So try: export PERL_CPANM_OPT="--mirror http://cpan.metacpan.org"

+4
source

Source: https://habr.com/ru/post/1273871/


All Articles