<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Effective Perler &#187; distributions</title>
	<atom:link href="http://www.effectiveperlprogramming.com/blog/category/book/chapters/distributions/feed" rel="self" type="application/rss+xml" />
	<link>http://www.effectiveperlprogramming.com</link>
	<description>Effective Perl Programming - write better, more idiomatic Perl</description>
	<lastBuildDate>Sat, 28 Jan 2012 02:19:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Use a Task distribution to specify groups of modules</title>
		<link>http://www.effectiveperlprogramming.com/blog/1283</link>
		<comments>http://www.effectiveperlprogramming.com/blog/1283#comments</comments>
		<pubDate>Sun, 14 Aug 2011 13:43:30 +0000</pubDate>
		<dc:creator>brian d foy</dc:creator>
				<category><![CDATA[distributions]]></category>
		<category><![CDATA[item]]></category>

		<guid isPermaLink="false">http://www.effectiveperlprogramming.com/?p=1283</guid>
		<description><![CDATA[Create Task distributions A Task distribution is like a normal Perl distribution in structure, but it doesn&#8217;t actually provide any code. It lists as pre-requisites all of the modules or distributions that you want to install so you can use a conventiional CPAN tool to install all of the dependencies. A Task is slightly different [...]]]></description>
			<content:encoded><![CDATA[<p>Create Task distributions</p>
<p>A <code>Task</code> distribution is like a normal Perl distribution in structure, but it doesn&#8217;t actually provide any code. It lists as pre-requisites all of the modules or distributions that you want to install so you can use a conventiional CPAN tool to install all of the dependencies. A <code>Task</code> is slightly different from the older way, a <code>Bundle</code>, but for most people and uses, a <code>Task</code> might be a better way.</p>
<p>You can create your <code>Task::*</code> distribution with your favorite module tool (see <span class="item">Item 80. Don’t start distributions by hand</span>). Once you have the basic structure, you edit the module file to document what your task does and you edit the build file to list the dependencies.</p>
<p>Suppose that you wanted to make one to install all of the modules mentioned in <i>Effective Perl Programming</i> (and we have in <a href="http://search.cpan.org/dist/Task-EffectivePerlProgramming">Task::EffectivePerlProgramming</a>).</p>
<p>To do this yourself, you first create the stub distribution:</p>
<pre class="brush:plain">
$ module-starter --module=Task::EffectivePerlProgramming
Class is Module::Starter
Created Task-EffectivePerlProgramming
Created Task-EffectivePerlProgramming/lib/Task
Created Task-EffectivePerlProgramming/lib/Task/EffectivePerlProgramming.pm
Created Task-EffectivePerlProgramming/t
Created Task-EffectivePerlProgramming/t/pod-coverage.t
Created Task-EffectivePerlProgramming/t/pod.t
Created Task-EffectivePerlProgramming/t/manifest.t
Created Task-EffectivePerlProgramming/t/boilerplate.t
Created Task-EffectivePerlProgramming/t/00-load.t
Created Task-EffectivePerlProgramming/ignore.txt
Created Task-EffectivePerlProgramming/Changes
Created Task-EffectivePerlProgramming/Build.PL
Created Task-EffectivePerlProgramming/README
Created Task-EffectivePerlProgramming/MANIFEST
Created starter directories and files
</pre>
<p>Next, you edit the <i>.pm</i> file to document your <code>Task::*</code> and to set a version number (the date is a good choice). Since this is a distribution like any other Perl distribution, when you install the <code>Task</code>, not only will the CPAN tool handle the dependencies, but it will also install the <code>Task::*</code> module, in this case <code>Task::EffectivePerlProgramming</code>. By adding a version to your distribution, you can update it later and use your CPAN tool to update your dependencies.</p>
<p>Here&#8217;s an extract of <i>lib/Task/EffectivePerlProgramming.pm</i> file:</p>
<pre class="brush:perl">
package Task::EffectivePerlProgramming;

our $VERSION = '20100714';

=head1 NAME

Task::EffectivePerlProgramming - All of the modules mentioned in Effective Perl Programming, 2nd Edition

=head1 SYNOPSIS

This is just a Task module to install dependencies. There's no code to use
or run.

=head1 DESCRIPTION

These are the modules we used in the book:

=over 4

=item * Apache::DBI

=item * Apache::Perldoc

=item * etc, etc

=back

=head1 LICENSE AND COPYRIGHT

Copyright 2010 brian d foy.

You can distribute this module under the same terms as Perl itself.

=cut

1;
</pre>
<p>In the <i>Build.PL</i>, you then list each of the modules that you want to install as a dependency. If you don&#8217;t care which version of the dependency you want to install, you can use <code>'0'</code> as the version since any version should be equal to or greater than that:</p>
<pre class="brush:perl">
use strict;
use warnings;
use Module::Build;

my $builder = Module::Build->new(
    module_name         => 'Task::EffectivePerlProgramming',
    license             => 'perl',
    dist_author         => q{brian d foy <bdfoy@cpan.org>},
    dist_version_from   => 'lib/Task/EffectivePerlProgramming.pm',
    requires            => {
		'Apache::DBI'     => '0',
		'Apache::Perldoc' => '0',
		'App::Ack'        => '0',
		# etc, etc,
		},
    build_requires => {
        'Test::More' => 0,
    	},
    add_to_cleanup     => [ 'Task-EffectivePerlProgramming-*' ],
    create_makefile_pl => 'traditional',
	);

$builder->create_build_script();
</pre>
<p>That&#8217;s it; you&#8217;re done! Well, don&#8217;t forget to run the tests to check your Pod for proper formatting. Once you&#8217;re ready, you can create your distribution:</p>
<pre class="brush:perl">
$ perl Build.PL
$ ./Build test
...
$ ./Build dist
Creating Makefile.PL
Deleting META.yml
Creating META.yml
Creating Task-EffectivePerlProgramming-20100714
Creating Task-EffectivePerlProgramming-20100714.tar.gz
Deleting Task-EffectivePerlProgramming-20100714
</pre>
<p>You can upload your distribution to CPAN, put it in your private module repository, email it to your coworkers, or pass it around however you like.<br />
If it&#8217;s on CPAN, you can install it as you would any other module:</p>
<pre class="brush:plain">
$ cpan Task::EffectivePerlProgramming
</pre>
<h2>Installing the task from a local file</h2>
<p>You don&#8217;t have to upload your <code>Task</code> distribution to CPAN to use it. You can install the prerequisites of a distribution as long as you have that distribution. You could</p>
<p>In the <code>cpan</code> command-line tool, you can install the current directory (just the dot), including its dependencies:</p>
<pre class="brush:plain">
$ cd Task-EffectivePerlProgramming
$ cpan .
</pre>
<p>The <a href="http://search.cpan.org/dist/App-cpanminus">cpanminus</a> command-line tool can install just the dependencies without installing the module inself (but that&#8217;s not necessarily a good thing):</p>
<pre class="brush:plain">
$ cd Task-EffectivePerlProgramming
$ cpanm --installdeps .
</pre>
<p>Since this <code>Task</code> used Module::Build, you can use the <code>installdeps</code> build target, although you have an extra step now:</p>
<pre class="brush:plain">
$ cd Task-EffectivePerlProgramming
$ perl Build.PL
$ Build installdeps
</pre>
<h2>Bundles are still good</h2>
<p><code>Task</code> distributions take the place of CPAN.pm&#8217;s auto-bundles, mostly, but miss a key feature of Bundles, which can install modules given a local file path instead of just a repository path.</p>
<p>You can generate an autobundle with <code>CPAN.pm</code>. The output lists the currently installed versions, the latest version in CPAN, and the relative path in CPAN-like archive. At the end, it writes the actual auto-bundle file:</p>
<pre class="brush:plain">
$ cpan -a
...
Net::POP3                      2.29      2.29  GBARR/libnet-1.22.tar.gz
Net::SMTP                      2.31      2.31  GBARR/libnet-1.22.tar.gz
Net::SSL                       2.84      2.85  NANIS/Crypt-SSLeay-0.58.tar.gz
...
warnings                       1.06      1.11  JESSE/perl-5.13.9.tar.gz
warnings::register             1.01      1.02  JESSE/perl-5.13.9.tar.gz

Wrote bundle file
    /Users/Buster/.cpan/Bundle/Snapshot_2011_08_16_00.pm
</pre>
<p>The bundle file has some metadata and a list of packages and versions:</p>
<pre class="brush:perl">
package Bundle::Snapshot_2011_08_16_00;

$VERSION = '0.01';

1;

__END__

=head1 NAME

Bundle::Snapshot_2011_08_16_00 - Snapshot of installation on Buster on Tue Aug 16 15:05:40 2011

=head1 SYNOPSIS

perl -MCPAN -e 'install Bundle::Snapshot_2011_08_16_00'

=head1 CONTENTS

Algorithm::Diff 1.1902

Apache::DBI 1.08

Apache::Perldoc 1.11

Apache::Test 1.31

App::Cache 0.36

App::Cmd 0.301

App::Module::Lister 0.13

App::cpanminus 1.0004

AppConfig 1.66
</pre>
<p>This auto-bundle is a list of everything you have installed, but it doesn&#8217;t have to be. You can list any packages and versions that you like. It&#8217;s completely up to you to decide what should be part of the task.</p>
<p>Putting this anywhere in your <code>@INC</code> (such as the current working directory) allows you to use the <code>cpan</code> tool to install it:</p>
<p><code><br />
$ cd /Users/Buster/.cpan<br />
$ cpan Bundle::Snapshot_2011_08_16_00<br />
</code></p>
<p><code>CPAN.pm</code> handles <code>Bundle</code>s specially to handle this. </p>
<p>Since the auto-bundle is a single file (although in a directory named <code>Bundle</code>), it might be easier for you to pass around. Either way, you have a way to tell people everything that should install.</p>
<h2>Some interesting Tasks</h2>
<p>Some <code>Task</code> distributions cover big topics, such as:</p>
<ul>
<li><a href="https://metacpan.org/module/Task::Kensho">Task::Kensho for Enlightened Perl development</a>
<li><a href="https://metacpan.org/module/Task::Dancer">Task::Dancer for extra goodies for the Dancer web framework</a>
<li><a href="https://metacpan.org/module/Task::Plack">Task::Plack for web middleware</a>
<li><a href="https://metacpan.org/module/Task::HTML5">Task::HTML5 for new Web hotness</a>
</ul>
<p>There are several <a href="https://metacpan.org/search?q=belike">Task::BeLike::</a> distributions that list people&#8217;s favorite tools and modules. If you want to do the same sorts of things as these people, you might want to install their <code>BeLike</code> distributions:</p>
<ul>
<li><a href="https://metacpan.org/module/Task::BeLike::AVAR">Be like Ævar Arnfjörð Bjarmason</a>
<li><a href="https://metacpan.org/module/Task::BeLike::RJBS">Be like Ricardo SIGNES</a>
<li><a href="https://metacpan.org/module/Task::BeLike::FLORA">Be like Florian Ragwitz</a>
</ul>
<h2>Things to remember</h2>
<ul>
<li>Collect project dependencies in a <code>Task</code> distribution
<li>Install the <code>Task</code> distribution like any other module distribution, or directly from the local directory
<li>Several tasks already exist on CPAN.
</ul>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Use+a+Task+distribution+to+specify+groups+of+modules+http://tinyurl.com/3e4uh9x" title="Post to Twitter"><img class="nothumb" src="http://www.effectiveperlprogramming.com/wp-content/plugins/tweet-this/icons/tt-twitter2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Use+a+Task+distribution+to+specify+groups+of+modules+http://tinyurl.com/3e4uh9x" title="Post to Twitter"> </a> <a class="tt" href="http://delicious.com/post?url=http://www.effectiveperlprogramming.com/blog/1283&amp;title=Use+a+Task+distribution+to+specify+groups+of+modules" title="Post to Delicious"><img class="nothumb" src="http://www.effectiveperlprogramming.com/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.effectiveperlprogramming.com/blog/1283&amp;title=Use+a+Task+distribution+to+specify+groups+of+modules" title="Post to Delicious"> </a> <a class="tt" href="http://digg.com/submit?url=http://www.effectiveperlprogramming.com/blog/1283&amp;title=Use+a+Task+distribution+to+specify+groups+of+modules" title="Post to Digg"><img class="nothumb" src="http://www.effectiveperlprogramming.com/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.effectiveperlprogramming.com/blog/1283&amp;title=Use+a+Task+distribution+to+specify+groups+of+modules" title="Post to Digg"> </a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.effectiveperlprogramming.com/blog/1283&amp;t=Use+a+Task+distribution+to+specify+groups+of+modules" title="Post to Facebook"><img class="nothumb" src="http://www.effectiveperlprogramming.com/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.effectiveperlprogramming.com/blog/1283&amp;t=Use+a+Task+distribution+to+specify+groups+of+modules" title="Post to Facebook"> </a> <a class="tt" href="http://reddit.com/submit?url=http://www.effectiveperlprogramming.com/blog/1283&amp;title=Use+a+Task+distribution+to+specify+groups+of+modules" title="Post to Reddit"><img class="nothumb" src="http://www.effectiveperlprogramming.com/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.effectiveperlprogramming.com/blog/1283&amp;title=Use+a+Task+distribution+to+specify+groups+of+modules" title="Post to Reddit"> </a></p>]]></content:encoded>
			<wfw:commentRss>http://www.effectiveperlprogramming.com/blog/1283/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find a module&#8217;s release managers</title>
		<link>http://www.effectiveperlprogramming.com/blog/884</link>
		<comments>http://www.effectiveperlprogramming.com/blog/884#comments</comments>
		<pubDate>Sun, 19 Dec 2010 16:41:32 +0000</pubDate>
		<dc:creator>brian d foy</dc:creator>
				<category><![CDATA[cpan]]></category>
		<category><![CDATA[distributions]]></category>
		<category><![CDATA[item]]></category>

		<guid isPermaLink="false">http://www.effectiveperlprogramming.com/?p=884</guid>
		<description><![CDATA[The CPAN ecosystem is more than just a way to share your code with other people. It&#8217;s also a way to let other people collaborate on the code and to help you release it. In Item 70. Contribute to CPAN, you saw how to upload your work to the Perl Authors Upload Server (PAUSE). There&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>The CPAN ecosystem is more than just a way to share your code with other people. It&#8217;s also a way to let other people collaborate on the code and to help you release it. In <span class="item">Item 70. Contribute to CPAN</span>, you saw how to upload your work to the <a class="external" href="http://pause.perl.org">Perl Authors Upload Server (PAUSE)</a>. There&#8217;s a lot more that you can do through PAUSE, though. Even if you aren&#8217;t a CPAN author, you can use PAUSE to find out more about a module&#8217;s authors and comaintainers.</p>
<h2>Some definitions</h2>
<p>There are several points to consider as you try to figure out how PAUSE works. Start with the defintions to ensure you&#8217;re thinking about the same things as you go through this Item. People are often quite loose with their terminology, so its useful to define these terms before you get started.</p>
<p>A <i>module</i> is a unit of Perl re-usability. It&#8217;s typically a single <i>.pm</i> file, but it might be more than one if it loads private plugins or other helpers. You load a module with <code>do</code> (rare), <code>require</code>, or <code>use</code>.</p>
<p>A <i>package</i> and a <i>namespace</i> are almost the same thing, but not quite. The package is really all the bits that live under a particular namespace, with is just the name you gave to the package. You declare a default namespace with the <code>package</code> built-in. You can affect the package in any file, but the namespace is just the label. A &#8220;module&#8221; and a &#8220;namespace&#8221; are often interchangeable terms because most modules use a single namespace, or at least a single, advertised namespace.</p>
<p>A <i>distribution</i> is a collection of modules or programs, along with ancillary files and installation information, turned into a single file with an archiving tool such as <code>tar</code> or <code>zip</code>. A distribution can contain several modules. In other words, the distribution is the thing you upload and share. Some people use &#8220;distribution&#8221; to refer to any of the releases with the same base name, such as <i>Moose-1.01.tgz</i>, <i>Moose-1.02.tgz</i>, &#8230; <i>Moose-1.21.tgz</i>.</p>
<p>PAUSE <i>indexes</i> a distribution by recording the namespaces and versions it finds and adding them to the database that produces the file <span class="filename">modules/02packagedetails.txt.gz</span>, which CPAN clients use to figure out what to download when you want to install a module.</p>
<h2>PAUSE only cares about uploads</h2>
<p>PAUSE is really just a release mechanism for CPAN. You upload a distribution, PAUSE looks at the namespaces you declare with <code>package</code>, and looks up those namespaces in its database. If it thinks you are allowed to upload those namespaces, PAUSE indexes your distribution. It examines the version numbers for the packages, and as long as the new versions are greater than the previous version values in the index, PAUSE adds your distribution information to its database.</p>
<p>If any of that fails, PAUSE sends you an email explaining what went wrong. PAUSE still puts your uploaded file in your author directory, but since PAUSE doesn&#8217;t add the unauthorized namespaces to the <span class="filename">modules/02packagedetails.txt.gz</span>, CPAN clients won&#8217;t see it.</p>
<h2>There are several sorts of maintainers</h2>
<p>To PAUSE, a <i>maintainer</i> is someone who can upload a distribution that PAUSE will index. The role is more like a release manager. You don&#8217;t have to be a PAUSE maintainer to work on and collaborate on CPAN code.</p>
<p>If you need to get something fixed and uploaded, there are two types of maintainers that may be able to help you: a primary or co-maintainer. There are some additional classifications of those, too.</p>
<p>You can be a <i>primary maintainer</i> or a <i>co-maintainer</i> of a namespace (not a distribution). The primary maintainer can assign or take-away co-maintainer permissions, as well as pass on primary maintainership to someone else (while losing that status in the process). PAUSE will index the namespaces in a distribution uploaded by any of these maintainers.</p>
<p>If you are the first person to upload a distribution using a particular namespace, you are a <i>first-come</i> maintainer. PAUSE assigns that namespace to you merely because you are the first person to use it. You don&#8217;t have to ask anyone&#8217;s permission or give any notice to use a new namespace. PAUSE, being mostly automated and mostly code, doesn&#8217;t care anything about your namespace other than it being new.</p>
<p>You can also add a <i>co-maintainer</i> for a namespace, which is really adding what most people would consider a <i>release manager</i>. By assigning co-maintainer permissions for a namespace, you tell PAUSE to index that namespace if that co-maintainer uploads it. As a co-maintainer, you do not have to upload the assigned namespace as part of the same distribution though. That shouldn&#8217;t be a common, or even intended, sort of upload though, and is likely to confuse people when they don&#8217;t get the distribution they expected. </p>
<p>There are two less-known types of maintainers too. A primary maintainer can also be a <i>module list</i> maintainer. That means that the maintainer registered the namespace with PAUSE. No one needs to register a namespace, but there are some some PAUSE features that only work with registered modules. For instance, you can register a namespace to &#8220;reserve&#8221; it for future use without uploading a distribution that uses that namespace.</p>
<p>Beyond that, there is also a <i>mailing list</i> maintainer. This is like a primary maintainership shared among anyone in the mailing list. Any one of those persons can assign or take away co-maintainer permissions. Projects such as PARROT and PERLCRITIC use the mailing list feature because they rotate release managers.</p>
<h2>Find a maintainer</h2>
<p>Any of the maintainers can upload a new distribution that PAUSE will index. That means that when you need to get something fixed, you may be able to find more than one person who can help you get a bug fixed and uploaded. Note, however, that you should also try the advertised support of the distribution, including its issue tracker (most likely <a class="external" href="http://rt.cpan.org">CPAN RT</a>), its mailing list, and so on. As you read earlier, maintainers are really just release managers so there may be other people who can work on the code.</p>
<p>If you have a PAUSE account (<span class="item">Item 70. Contribute to CPAN</span>), you can use the PAUSE interface to search the permissions database. You can search by the maintainer name, the exact module name, or use a string for an <a class="external" href="http://www.sql-tutorial.net/SQL-LIKE.asp">SQL LIKE query</a>. The results for any search allow you to drill down into the results by the namespace or the author name.</p>
<div align="center" style="margin-top: 25px; margin-bottom: 25px">
<iframe src="http://player.vimeo.com/video/17980388" width="400" height="300" frameborder="0"></iframe>
<p><a class="external" href="http://www.vimeo.com/17980388">Inspecting Perl namespace permissions on PAUSE</a></p>
</div>
<p>If you don&#8217;t have a PAUSE account, you can still look through the permissions for all of the namespaces. A couple of years ago, PAUSE added the <span class="filename">$CPAN/module/06perm.txt</span> file which lists each namespace:</p>
<p><br/></p>
<pre class="plain">
File:        06perms.txt
Description: CSV file of upload permission to the CPAN per namespace
    best-permission is one of "m" for "modulelist", "f" for
    "first-come", "c" for "co-maint"
Columns:     package,userid,best-permission
Line-Count:  175031
Written-By:  Id
Date:        Sun, 19 Dec 2010 09:08:52 GMT

A,ADAMK,f
A::B,CODEREPOS,c
A::B,MARCEL,f
AA,RLZWART,f
AA::GAMP,RLZWART,f
AAA::Demo,JWACH,f
AAA::eBay,JWACH,f
AAAA::Crypt::DH,BINGOS,f
AAC::Pvoice,JOUKE,f
AAC::Pvoice::Bitmap,JOUKE,f
AAC::Pvoice::Dialog,JOUKE,f
AAC::Pvoice::EditableRow,JOUKE,f
AAC::Pvoice::Input,JOUKE,f
AAC::Pvoice::Panel,JOUKE,f
AAC::Pvoice::Row,JOUKE,f
</pre>
<p><br/></p>
<p>The <span class="filename">$CPAN/module/06perm.txt</span> has three fields: namespace, PAUSE author, and the type of permission. The one-letter permission code is explained in the file header. Using <code>grep</code> or a Perl one-liner as a poor man&#8217;s query tool is often sufficient to find what you want:</p>
<div align="center" style="margin-top: 25px; margin-bottom: 25px">
<iframe src="http://player.vimeo.com/video/17980939" width="400" height="300" frameborder="0"></iframe>
<p><a class="external" href="http://www.vimeo.com/17980939">Search Perl namespace permissions in 06perms.txt</a></p>
</div>
<p>As a bonus, notice the use of the <code>-a</code> and <code>-F</code> switches to <code>perl</code>. The <code>-a</code> autosplits each line using whitespace as the delimiter. However, if you use the <code>-F</code> switch, you can specify an alternate delimiter. Either way, the results end up in the <code>@F</code> array. </p>
<p>In this example, you use <code>-F</code> to split on a comma then match against <code>$F[0]</code> to find namespaces:</p>
<pre class="plain">
$ perl -F, -ane  'print if $F[0] =~ /^CPAN::/' 06perms.txt
</pre>
<p>If you wanted to find an author, you can look in <code>$F[1]</code>:</p>
<pre class="plain">
$ perl -F, -ane  'print if $F[1] eq q|BDFOY|' 06perms.txt
</pre>
<h2>You don&#8217;t have to be a maintainer to work on the code</h2>
<p>Although the term &#8220;maintainer&#8221; implies that you also work on the code, some maintainers do nothing more than uploading the distribution. Likewise, not everyone who actually maintains or works on the code needs co-maintainer permissions in PAUSE.</p>
<h2>You don&#8217;t own heirarchies</h2>
<p>When PAUSE assigns you a namespace as a primary maintainer, you only &#8220;own&#8221; exactly that namespace. Although Perl namespaces look like they are hierarchial, they aren&#8217;t. That is, there&#8217;s nothing in Perl that cares what namespace you use or which one your package inherits from. The <code>XML::Simple</code> namespaces doesn&#8217;t inherit from <code>XML</code> by virtue of its name. In the same way, you don&#8217;t have any permissions on <code>Foo::Bar::Baz</code> merely because PAUSE assigned you permissions on <code>Foo::Bar</code>. That means you don&#8217;t have to rush to register your company&#8217;s name as a namespace because it&#8217;s not going to prevent anyone from using it for another namespace.</p>
<p>As part of the lack of proper heirarchies, you also have to assign comaintainer permissions on every particular namespace that you want to share.</p>
<h2>Fix your &#8220;unauthorized&#8221; release</h2>
<p>Even if PAUSE does not index your distribution, it still puts it in your author directory. The CPAN servers still mirror everything in your author directory, just like they mirror old distributions that do not appear in the index. The <a class="external" href="http://search.cpan.org">CPAN Search website</a> still shows the distribution but puts a big red <span style="color: red">UNAUTHORIZED</span> next to the distribution name and also the namespaces with the missing permissions:</p>
<div align="center">
<a href="http://www.effectiveperlprogramming.com/wp-content/uploads/unauthorized_release.png"><img src="http://www.effectiveperlprogramming.com/wp-content/uploads/unauthorized_release.png" width="400" height="537"></a>
</div>
<p><br/></p>
<p>To fix this, you need to get the missing co-maintainer permissions. The primary maintainer or the mailing list members will have to help you with that. As a last resort, you can ask the admins at <span class="email">modules@perl.org</span> for help.</p>
<h2>Things to remember</h2>
<ul>
<li>A PAUSE or CPAN author is really a release manager.
<li>A primary maintainer can assign co-maintainer permissions.
<li>You can search permissions through the PAUSE interface.
<li>You can search permissions in the <span class="filename">$CPAN/modules/06perms.txt</span> file.
</ul>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Find+a+module%E2%80%99s+release+managers+http://tinyurl.com/6xcfqbr" title="Post to Twitter"><img class="nothumb" src="http://www.effectiveperlprogramming.com/wp-content/plugins/tweet-this/icons/tt-twitter2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Find+a+module%E2%80%99s+release+managers+http://tinyurl.com/6xcfqbr" title="Post to Twitter"> </a> <a class="tt" href="http://delicious.com/post?url=http://www.effectiveperlprogramming.com/blog/884&amp;title=Find+a+module%E2%80%99s+release+managers" title="Post to Delicious"><img class="nothumb" src="http://www.effectiveperlprogramming.com/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.effectiveperlprogramming.com/blog/884&amp;title=Find+a+module%E2%80%99s+release+managers" title="Post to Delicious"> </a> <a class="tt" href="http://digg.com/submit?url=http://www.effectiveperlprogramming.com/blog/884&amp;title=Find+a+module%E2%80%99s+release+managers" title="Post to Digg"><img class="nothumb" src="http://www.effectiveperlprogramming.com/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.effectiveperlprogramming.com/blog/884&amp;title=Find+a+module%E2%80%99s+release+managers" title="Post to Digg"> </a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.effectiveperlprogramming.com/blog/884&amp;t=Find+a+module%E2%80%99s+release+managers" title="Post to Facebook"><img class="nothumb" src="http://www.effectiveperlprogramming.com/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.effectiveperlprogramming.com/blog/884&amp;t=Find+a+module%E2%80%99s+release+managers" title="Post to Facebook"> </a> <a class="tt" href="http://reddit.com/submit?url=http://www.effectiveperlprogramming.com/blog/884&amp;title=Find+a+module%E2%80%99s+release+managers" title="Post to Reddit"><img class="nothumb" src="http://www.effectiveperlprogramming.com/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.effectiveperlprogramming.com/blog/884&amp;title=Find+a+module%E2%80%99s+release+managers" title="Post to Reddit"> </a></p>]]></content:encoded>
			<wfw:commentRss>http://www.effectiveperlprogramming.com/blog/884/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install scripts from distributions</title>
		<link>http://www.effectiveperlprogramming.com/blog/81</link>
		<comments>http://www.effectiveperlprogramming.com/blog/81#comments</comments>
		<pubDate>Sun, 28 Mar 2010 15:57:05 +0000</pubDate>
		<dc:creator>brian d foy</dc:creator>
				<category><![CDATA[distributions]]></category>
		<category><![CDATA[item]]></category>

		<guid isPermaLink="false">http://www.effectiveperlprogramming.com/?p=81</guid>
		<description><![CDATA[Perl&#8217;s distribution system is quite powerful and supported by a variety of tools that can make life easier for you. Most people tend to think that &#8220;distributions&#8221; are synonymous with modules, but that&#8217;s only one of the uses for distributions. In Item 91: Write Scripts as Modules, we talk about the creating programs as &#8220;modulinos&#8221;, [...]]]></description>
			<content:encoded><![CDATA[<p>Perl&#8217;s distribution system is quite powerful and supported by a variety of tools that can make life easier for you. Most people tend to think that &#8220;distributions&#8221; are synonymous with modules, but that&#8217;s only one of the uses for distributions.</p>
<p>In <span class="item">Item 91: Write Scripts as Modules</span>, we talk about the creating programs as &#8220;modulinos&#8221;, or little modules. You segregate everything into subroutines and activate your code through a <code>run()</code> subroutine, similar to the <code>main</code> subroutine you&#8217;d use in other languages. I&#8217;ve written about this a lot elsewhere, including my TPJ article <a href="http://www.drdobbs.com/184416165">Scripts As Modules</a> and an entire chapter in <a href="http://www.amazon.com/dp/0596527241?tag=theeffeperl-20&#038;camp=14573&#038;creative=327641&#038;linkCode=as1&#038;creativeASIN=0596527241&#038;adid=0H6SYJ1AWB9Y9MDE70F3&#038;" >Mastering Perl</a>.</p>
<p>A modulino is a great way to start a new program, but it&#8217;s often too much work to convert an existing program if you only have a little time available. You can still get a lot of the benefits of a Perl distribution, such as dependency management and installation, even without the module portion.</p>
<p>Typically, in your distribution you put your modules under the <i>lib</i> directory. You&#8217;d put your <code>Cat::Burglar</code> module in <i>lib/Cat/Burglar.pm</i>. Your build system (<span class="item">Item 79: Use Module::Build</span>) sees what is in <i>lib</i> and copies it into <i>blib/lib</i>, the build library which is the intermediate staging area for the installation. When you install your distribution, the build system copies the contents of <i>blib</i> into the right places. You don&#8217;t have to have just modules in your distribution, though.</p>
<p>You can also have a <i>bin</i> directory under <i>blib</i>. The build system copies the contents of the <i>blib/bin</i>. You don&#8217;t have to stage your programs manually. Suppose that you stored your program in the distribution as <i>script/cat_burglar</i>, although the location isn&#8217;t magical. For Makemaker, you use the <code>EXE_FILES</code> argument to stage the program for installation:</p>
<pre class="brush:perl">
	use ExtUtils::Makemaker;

	WriteMakefile(
		...
		'EXE_FILES'    => [ qw(script/cat_burglar) ],
		...
		);
</pre>
<p>For <a href="http://search.cpan.org/dist/Module-Build">Module::Build</a>, you use the <code>script_files</code> argument:</p>
<pre class="brush:perl">
my $build = Module::Build->new
	(
	...
	script_files => [ qw(script/cat_burglar) ],
	...
	);
</pre>
<p>You set up the rest of the build file normally, specifying such things as the prerequisites for configuring, building, and running the program, creating the distribution archive, and so on. You don&#8217;t even need to have any modules. You can have just modules, just scripts, or scripts and modules combined. You just have to set up the build file appropriately. Once you&#8217;ve done that, you can treat your programs just as you do any other distribution. When you want to install it, you go through the same process that you do with modules:</p>
<pre class="brush:plain">
% perl Build.PL
% ./Build install
</pre>
<p>You can even use the <code>cpan</code> tool to install from the current directory, including all of its dependencies:</p>
<pre class="brush:plain">
% cpan .
</pre>
<p>Although I now tend to write most programs of any consequence as modulinos, when I first started putting my programs into distributions I wrote a tool that I called <a href="http://search.cpan.org/dist/scriptdist">scriptdist</a> to turn single program files into complete distributions. I wrote about that for TPJ as <a href="http://www.drdobbs.com/web-development/184416112">Automating script distributions with scriptdist</a>. Although it&#8217;s a bit dated, it&#8217;s essentially in the same state. If you don&#8217;t like its templates, you can modify them to make your own.</p>
<p>Simply wrapping your program in a distribution is merely a first step, but it&#8217;s better than nothing until you have time to pay more attention to it.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Install+scripts+from+distributions+http://tinyurl.com/63dsrum" title="Post to Twitter"><img class="nothumb" src="http://www.effectiveperlprogramming.com/wp-content/plugins/tweet-this/icons/tt-twitter2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Install+scripts+from+distributions+http://tinyurl.com/63dsrum" title="Post to Twitter"> </a> <a class="tt" href="http://delicious.com/post?url=http://www.effectiveperlprogramming.com/blog/81&amp;title=Install+scripts+from+distributions" title="Post to Delicious"><img class="nothumb" src="http://www.effectiveperlprogramming.com/wp-content/plugins/tweet-this/icons/tt-delicious.png" alt="Post to Delicious" /></a> <a class="tt" href="http://delicious.com/post?url=http://www.effectiveperlprogramming.com/blog/81&amp;title=Install+scripts+from+distributions" title="Post to Delicious"> </a> <a class="tt" href="http://digg.com/submit?url=http://www.effectiveperlprogramming.com/blog/81&amp;title=Install+scripts+from+distributions" title="Post to Digg"><img class="nothumb" src="http://www.effectiveperlprogramming.com/wp-content/plugins/tweet-this/icons/tt-digg.png" alt="Post to Digg" /></a> <a class="tt" href="http://digg.com/submit?url=http://www.effectiveperlprogramming.com/blog/81&amp;title=Install+scripts+from+distributions" title="Post to Digg"> </a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.effectiveperlprogramming.com/blog/81&amp;t=Install+scripts+from+distributions" title="Post to Facebook"><img class="nothumb" src="http://www.effectiveperlprogramming.com/wp-content/plugins/tweet-this/icons/tt-facebook.png" alt="Post to Facebook" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://www.effectiveperlprogramming.com/blog/81&amp;t=Install+scripts+from+distributions" title="Post to Facebook"> </a> <a class="tt" href="http://reddit.com/submit?url=http://www.effectiveperlprogramming.com/blog/81&amp;title=Install+scripts+from+distributions" title="Post to Reddit"><img class="nothumb" src="http://www.effectiveperlprogramming.com/wp-content/plugins/tweet-this/icons/tt-reddit.png" alt="Post to Reddit" /></a> <a class="tt" href="http://reddit.com/submit?url=http://www.effectiveperlprogramming.com/blog/81&amp;title=Install+scripts+from+distributions" title="Post to Reddit"> </a></p>]]></content:encoded>
			<wfw:commentRss>http://www.effectiveperlprogramming.com/blog/81/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

