I encountered an invalid license value (which I've redacted to XXX) when working with a legacy Makefile.PL which contained:

WriteMakefile( ... LICENSE => 'XXX', ... );

When I ran perl Makefile.PL, I got:

Invalid LICENSE value 'XXX'

I looked in the LICENSE section of ExtUtils::MakeMaker. That didn't provide any direct help but had a link to CPAN::Meta::Spec for more information. Looking in the license section of that document, I found examples showing values as arrayrefs, followed by a list of the only valid values. I changed Makefile.PL to:

LICENSE => ['restricted'],

Running perl Makefile.PL again, I now get:

WARNING: LICENSE takes a string/number not a ARRAY reference.

I thought it was a bit of a long shot but, as CPAN::Meta::Spec had consistently used lowercase license, I tried:

license => ['restricted'],

but that only got me

WARNING: license is not a known parameter.

Anyway, I found that

LICENSE => 'restricted',

generated no warning or error messages. I had several legacy modules to deal with and subsequently came across one with

LICENSE => 'unrestricted',

which also worked without any issues.

So, that solved my immediate problem.

However, I'm still a little baffled by the apparent contradiction of a single string versus an array of strings; especially as CPAN::Meta::Spec has in its DESCRIPTION:

"Distribution building tools like ... ExtUtils::MakeMaker ... should create a metadata file in accordance with this specification ..."

I don't see how ExtUtils::MakeMaker, which only allows a single license value, could create the multiple license values as described in CPAN::Meta::Spec.

I get the feeling that one or both of these modules has problematic documentation, or that I'm missing some other information which glues these two together.

Any enlightenment would be greatly appreciated.

— Ken


In reply to How are license keys of ExtUtils::MakeMaker and CPAN::Meta::Spec related? by kcott

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.