<?xml version="1.0" encoding="windows-1252"?>
<node id="606322" title="Re: scripts on CPAN" created="2007-03-23 14:30:42" updated="2007-03-23 10:30:42">
<type id="11">
note</type>
<author id="144850">
rinceWind</author>
<data>
<field name="doctext">
&lt;p&gt;As you have implied in your first sentence, CPAN is all about distributions. There's more to a distribution than shipping code that the user can run. There's documentation, tests, examples, and control files that help you verify that your distribution is complete. A standalone script wouldn't have all, or indeed any of this provided.&lt;/p&gt;

&lt;p&gt;The traditional way of distributing a script is as a standalone file that needs to be copied into a special place, e.g. a cgi-bin directory. There may be some manual configuring required with an editor, to set variables to contain real paths on the target machine. As a potential user, putting the script live is a great leap of faith. There's no reassurance that it will work with the configuration of the machine on which it's being installed.&lt;/p&gt;

&lt;p&gt;A much better idea is to put all your functionality into one or more .pm files, and ship a bare bones script that calls the module(s). The reason why it's better is that you can write tests that call the module API and exercise the code completely.&lt;/p&gt;

&lt;p&gt;The installer of your distribution gets to run tests of the module's functionality &lt;strong&gt;during&lt;/strong&gt; the installation process, and is instantly made aware of any problems, &lt;strong&gt;before&lt;/strong&gt; the module is installed. This becomes even more important when it comes to upgrading an existing installation.&lt;/p&gt;


&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-144850"&gt;
&lt;p&gt;&lt;small&gt;--&lt;br /&gt;Apprentice [http://www.innercompass.co.uk/|wetware hacker]&lt;/small&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
606296</field>
<field name="parent_node">
606296</field>
</data>
</node>
