what is bundle?

it is a perl module which itself does not contain any code but it contains a list of modules to be installed.

why do we need a bundle?

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.


why do we need to keep the bundle in our private server?
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.
although cpan have a backup mirror from where you can get its source.

steps to create a private bundle
by private bundle I mean that every thing is kept on private server and cpan shell have only one url in its url_list
i.e. o conf urllist should only have http:www.xyz/Bundle
Now lets go into the contents of Bundle folder
modules-02packages.details.txt.gz and 03modlist.dat.gz
authors-01mailrc.txt.gz and id folder->folder named from A-Z


further id folder have folder named A-Z and these folder have futher folders named acc to authors names
eg T/TI/TIMB so TIMB is a author given a folder TIMB

M/MA/MARSAB

you can easily get 01,02,03 file. leaving it upto you.
now keep all the modules required in their respective authors folder(you can see the path of each module in 02 file)
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).
now create a PAUSE account and upload your Bundle::abc
make sure that 02 file should be updated enough that it contains ur bundle and ur path.
suppose you have registered yourself as WXZY so Bundle::abc should be in authors/id/W/WX/WXYZ

copy the source of ur own module(bundle) and keep it there.
now enter cpan shell
perl -MCPAN -e shell
>install Bundle::abc
will now install all the modules in the list.
i hope this will give a little idea to the newbies like me.

thanks!!!

ansh batra
PS:please Excuse me if i have presented this in bad manner
this is my first article
  • Comment on how to create a CPAN bundle for your own private server

Replies are listed 'Best First'.
Re: how to create a CPAN bundle for your own private server
by marto (Cardinal) on Nov 08, 2011 at 11:42 UTC

    "PS:please Excuse me if i have presented this in bad manner this is my first article"

    Tutorials gives advice on posting:

    "now create a PAUSE account and upload your Bundle::abc"

    Are you sure you want to pollute CPAN with Bundles which are specific to your applications/scripts? IMHO this isn't want it's for. Why not just store all this locally on an internal server, along with a cpan mirror (created using minicpan)? If one of your complaints is that certain versions of modules may be required take responsability for making them available in this manner. Alternativly consider using PAR to package your scripts, module dependencies and data.

    Also your instructions aren't very clear (IMHO)

    Update: Also, you mention "private server" in the title, but from what you've written you're uploading to PAUSE (not private).

    Update 2: This post was written before the thread was moved from tutorials to Meditations.

      the reason for uploading the bundle are
      1.02packages.details.txt.gz will have the name of your bundle and ull be using this(updated) file
      2.youll get the checksums for your bundle which i think cannot be created manually
      now once you have done your job you may delete your bundle from CPAN since it is of no use for the outside world!!!
      thanks!!!

        "now once you have done your job you may delete your bundle from CPAN"

        So why are you publishing it to the world if nobody else is interested in it? Then you're going to delete it from CPAN? You seem confused, also your exclamation mark key seems faulty.

        Consider my suggestions of a local cpan mirror internal to your company, and 'releasing' your application specific bundles to that, rather than the public CPAN. http://blogs.perl.org/users/randy_stauner/2011/06/releasing-to-minicpan.html

        Again (IMHO) this would have been discussed had this been posted as a meditation rather than directly in Tutorials.

        Update: This post was written before the thread was moved from Tutorials to Meditations.

        once you have done your job you may delete your bundle from CPAN since it is of no use for the outside world!!! thanks!!!

        If its of no use to the outside world, why upload to CPAN?

      Are you sure you want to pollute CPAN with Bundles which are specific to your applications/scripts?

      Why not? Isn't that what bundles are for?

        No it isn't what CPAN is for.