I am aware you can easily configure cpan to use a specific mirror. However I recently started using cpanm at the advice of a friend, and I can't seem to find a way to set the default mirror without specifying --mirror http://cpan.metacpan.org
on the command line each time.
Is there an environment variable or a config file that I can set the default mirror?
As for why I would want to simply not use the default list of mirrors, I am an FI and we are firewalled to no end. Only one mirror has been allowed through our firewall.
Cite from the cpanm docs
ENVIRONMENT VARIABLES
PERL_CPANM_OPT If set, adds a set of default options to every cpanm command. These options come first, and so are overridden by command-line options.
So try: export PERL_CPANM_OPT="--mirror http://cpan.metacpan.org"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With