in reply to how is the CPAN_OPTS environment variable supposed to work?

Hi grobber,

I am afraid all I can do is confirm the behaviour you report above.

To workaround it I set a shell alias with alias cpan="cpan -T"

(...although I personally use cpanm...)

Hope this helps!


The way forward always starts with a minimal test.

Replies are listed 'Best First'.
Re^2: how is the CPAN_OPTS environment variable supposed to work?
by marto (Cardinal) on Jan 03, 2020 at 09:04 UTC

    cpanm lets you set this up with the environment variable PERL_CPANM_OPT=-n, confirmed working.

      Thanks!

      The discussion on github has since extended to track down the actual issue in the cpan source code: it pushes the contents of CPAN_OPTS onto the argument array instead of unshifting. We'll see if the devs end up making that small change to fix this.

        cpanm is faster and lighter on resources, perhaps worth considering anyway, depending on your goal.