I'm running:
${HOME}/perl5/bin/cpan version 1.64 calling Getopt::Std::getopts (vers +ion 1.12 [paranoid]), running under Perl version 5.28.1.
I have been trying to run installs without testing by setting the CPAN_OPTS environment variable as documented in the cpan manpages. The problem is that the contents of that variable seem to be appended rather than prepended to the rest of my arguments. The three commands
cpan CPAN -T CPAN_OPTS="-T" cpan CPAN export CPAN_OPTS="-T" && cpan CPAN
have exactly the same effect:
Loading internal logger. Log::Log4perl recommended for better logging Reading '${HOME}/.cpan/Metadata' Database was generated on Thu, 02 Jan 2020 14:41:03 GMT CPAN is up to date (2.27). >(error): Could not expand [-T]. Check the module name. >(info): I can suggest names if you install one of Text::Levenshtein:: +XS, Text::Levenshtein::Damerau::XS, Text::Levenshtein, and Text::Leve +nshtein::Damerau::PP >(info): and you provide the -x option on invocation. >(error): Skipping -T because I couldn't find a matching namespace.

---
I have posted an issue on github at https://github.com/andk/cpanpm/issues/131 but I thought perhaps someone here might have some insight that could help resolve this faster.

In reply to how is the CPAN_OPTS environment variable supposed to work? by grobber

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.