# from [EMAIL PROTECTED]
# on Wednesday 21 February 2007 12:03 pm:
>After searching through a few more document pages on CPAN, I decided
> to look through the source instead, and I found the relevant item in
> Module::Build::Base
>
> my %licenses =
...
> );
> sub valid_licenses {
> return \%licenses;
> }
>
>I resumed searching through the available documentation in the
>Module::Build subclass documentation, and it wasn't until I clicked on
>Module::Build::API that I found it.
>
>Now, there are a couple of problems here. One is that I wouldn't have
>expected to find the valid licenses in Module::Build::API
Agreed. The M.B.Authoring pod should probably serve as an entry point,
with links for things like "how do I add to META.yml?"
Maybe M.B.Authoring#licenses or M.B.Authoring.Properties#licenses?
>Secondly, there's the classic problem of code-to-document disconnect.
> The key 'open_source' in %licenses has undef as a value, but in
> M::B::API, there's a link to 'http://www.opensource.org/licenses/'.
...
>2) If so, is there a way to automatically include the %licenses
> variable in POD documentation?
...
>3) If neither one above is any good, is there some way to
> auto-generate a LICENSES file to put in the distribution?
I'm all for DRY (SPOT), but I've never really liked the idea of runtime
fetching values from pod just because pod is static. I really wish pod
were more dynamic, but alas.
How about just including perl and gpl items in the pod, then a "for
other licenses see the output of" bit like so:
perl -MModule::Build -e 'Module::Build->print_valid_licenses'
(aside: It could be a build action, but that would require one to have a
Build script, which would then need to be recreated after choosing a
license and putting it in Build.PL.)
Besides sidestepping the pod-parsing issue, the added benefit of keeping
it in code is that plugins or site/user prefs can add to the output.
--Eric
--
Anyone who has the power to make you believe absurdities has the power
to make you commit injustices.
--Voltaire
---------------------------------------------------
http://scratchcomputing.com
---------------------------------------------------