<?xml version="1.0" encoding="windows-1252"?>
<node id="936746" title="how to create a CPAN bundle for your own private server" created="2011-11-08 06:08:31" updated="2011-11-08 06:08:31">
<type id="120">
perlmeditation</type>
<author id="918452">
ansh batra</author>
<data>
<field name="doctext">
what is bundle?&lt;br&gt;
&lt;br&gt;
it is a perl module which itself does not contain any code but it contains a list of modules to be installed.
&lt;br&gt;&lt;br&gt;


why do we need a bundle?
&lt;br&gt;&lt;br&gt;
suppose you have written a program which uses some perl modules, then rather than installing all of them one by one , you should create a list of modules and their dependencies and keep it in the bundle,so by just installing the bundle you can get all the modules.
&lt;br&gt;&lt;br&gt;&lt;br&gt;


why do we need to keep the bundle in our private server?
&lt;br&gt;
since all modules are maintained by its author , he can any time upgrade it or delete it from cpan so if you keep your bundle on cpan , xyz module may not be found.
&lt;br&gt;
although cpan have a backup mirror from where you can get its source.


&lt;br&gt;&lt;br&gt;


steps to create a private bundle
&lt;br&gt;
by private bundle I mean that every thing is kept on private server and cpan shell have only one url in its url_list
&lt;br&gt;
i.e. o conf urllist should only have http:www.xyz/Bundle
&lt;br&gt;
Now lets go into the contents of Bundle folder
&lt;br&gt;
modules-02packages.details.txt.gz and 03modlist.dat.gz&lt;br&gt;
authors-01mailrc.txt.gz and id folder-&gt;folder named from A-Z
&lt;br&gt;
&lt;br&gt;&lt;br&gt;
further id folder have folder named A-Z and these folder have futher folders named acc to authors names
&lt;br&gt;
eg T/TI/TIMB so TIMB is a author given a folder TIMB
&lt;br&gt;&lt;br&gt;
M/MA/MARSAB

&lt;br&gt;&lt;br&gt;
you can easily get 01,02,03 file. leaving it upto you.
&lt;br&gt;
now keep all the modules required in their respective authors folder(you can see the path of each module in 02 file)
&lt;br&gt;
Now create a module named Bundle::abc using the command h2xs -n Bundle::abc
now go to the folder and open abc.pm file and just above "=head2 EXPORT" write "=head1 CONTENTS" and inbetween write list of required modules(including all dependencies.if you dnt want dependencies in the list then also you have to keep their source in the bundle and select "follow" option during cpan shell configuration).
&lt;br&gt;
now create a PAUSE account and upload your Bundle::abc&lt;br&gt;

make sure that 02 file should be updated enough that it contains ur bundle and ur path.&lt;br&gt;

suppose you have registered yourself as WXZY so Bundle::abc should be in authors/id/W/WX/WXYZ&lt;br&gt;
&lt;br&gt;
copy the source of ur own module(bundle) and keep it there.
&lt;br&gt;
now enter cpan shell
&lt;br&gt;
perl -MCPAN -e shell
&lt;br&gt;
&gt;install Bundle::abc
&lt;br&gt;
will now install all the modules in the list.
&lt;br&gt;
i hope this will give a little idea to the newbies like me.
&lt;br&gt;&lt;br&gt;
thanks!!!
&lt;br&gt;&lt;br&gt;
ansh batra&lt;br&gt;

PS:please Excuse me if i have presented this in bad manner&lt;br&gt;
this is my first article</field>
</data>
</node>
