<?xml version="1.0" encoding="windows-1252"?>
<node id="317309" title="How the CB created another CPAN module: Devel::Required" created="2003-12-28 13:25:15" updated="2005-07-08 15:21:59">
<type id="120">
perlmeditation</type>
<author id="272239">
liz</author>
<data>
<field name="doctext">
In a recent discussion in the CB, [castaway] mentioned that she missed a list of required modules in the documentation of one of my modules.  This initially resulted in the code snippet [id://316828].
&lt;P&gt;
Not being happy with the result, I decided to put this into a module which is on CPAN now: [cpan://Devel::Required].
&lt;P&gt;
From the pod:
&lt;DL&gt;
&lt;DT&gt;NAME
&lt;DD&gt;
       Devel::Required - Automatic update of required modules documentation
&lt;P&gt;
&lt;DT&gt;SYNOPSIS
&lt;DD&gt;&lt;PRE&gt; use ExtUtils::MakeMaker;
 eval "use Devel::Required"; # auto-update documentation if needed
 WriteMakefile (
  NAME         =&gt; "Your::Module",
  VERSION_FROM =&gt; "lib/Your/Module.pm",
  PREREQ_PM    =&gt; { 'Foo' =&gt; '1.0', 'Bar::Baz' =&gt; '0.05' }
 );
&lt;/PRE&gt;
&lt;P&gt;
&lt;DT&gt;DESCRIPTION
&lt;DD&gt;The Devel::Required module only serves a purpose in the development
       environment of an author of a CPAN module (or more precisely: a user of
       the ExtUtils::MakeMaker module.  It makes sure that any changes to the
       required modules specified in the Makefile.PL are automatically
       reflected in the README file and in the main source file (if
       implicitely specified).
&lt;P&gt;
       It takes the information given with the PREREQ_PM parameter and writes
       this to the README file, as well as to the POD of the file specified
       with the VERSION_FROM parameter.
&lt;P&gt;
       This module should only be installed on the system of the developer.
&lt;P&gt;
       The following files will be changed:
&lt;P&gt;
&lt;DL&gt;
&lt;DT&gt;README
&lt;DD&gt;The README file should exists in the current directory.  It should at
         least have this marker text:
&lt;PRE&gt;
 Required Modules:            &lt;- must start at beginning of line
                              &lt;- empty line
                              &lt;- another empty line
&lt;/PRE&gt;
After Makefile.PL is executed (using the example of the SYNOPSIS, the
         above will be changed to:
&lt;PRE&gt;
 Required Modules:            &lt;- must start at beginning of line
  Foo (1.0)                   &lt;- added
  Bar::Baz (0.05)             &lt;- added
                              &lt;- empty line
                              &lt;- another empty line
&lt;/PRE&gt;
&lt;P&gt;
         No changes will be made if the marker text is not found.
&lt;P&gt;
&lt;DT&gt;Module file
&lt;DD&gt;The file indicated with the "VERSION_FROM" parameter, will be
         searched for a marker text that consists of the lines:
&lt;PRE&gt;
 =head1 REQUIRED MODULES      &lt;- must start at beginning of line
                              &lt;- empty line
 =(anything)                  &lt;- any other pod directive
&lt;/PRE&gt;
&lt;P&gt;
After Makefile.PL is executed (using the example of the SYNOPSIS, the
         above will be changed to:
&lt;PRE&gt;
 =head1 REQUIRED MODULES      &lt;- must start at beginning of line
                              &lt;- empty line
 Foo (1.0)                    &lt;- added
 Bar::Baz (0.05)              &lt;- added
                              &lt;- empty line
 =(anything)                  &lt;- any other pod directive
&lt;/PRE&gt;
         No changes will be made if the marker text is not found.
&lt;/DL&gt;
&lt;/DL&gt;
&lt;P&gt;
Now only to change of all my modules to use this new feature...  ;-)
&lt;P&gt;
Liz</field>
</data>
</node>
