Hello All,

Intro.

Is there a "better" way to bundle the Digest::MD5 module with a distributed application? I want to make sure I'm bundling a tricky module like, Digest::MD5 correctly.

Background

I develop a very very popular CGI script. It comes with many CPAN modules. Let's say the cgi script itself is called, script.cgi. Along with the script.cgi file, there's a LIB directory. Inside the lib file are all the .pm files that are use'd/require'd by the script.cgi file.

In the lib directory, there's also a perllib directory, where I put modules fetched from CPAN in. I bundle the CPAN modules with the program, because I don't expect:

(1 that they will be installed by default and

(2 don't expect the user of my program (demographic: everyone from the casual website creator to professional JAPHY) to install each of the CPAN modules separately.

(3 I respect the Laziness of my users.

If that's hard to understand, here's a outline: (- = directories, + = files)

 
+script.cgi
    -LIB
        +IHandleErrorsForScript.pm
        +IHandleCGIScreensForScript.pm
        +ETC.pm
        +ETC.pm
        +ETC.pm
        -perllib
            +CGI.pm
            -HTML
                +Template.pm
            -MIME
                +Lite.pm
In the script.cgi file, the perllib directory is tweaked like so:
use lib qw(./LIB ./LIB/perllib
This means, my perllibs will be checked before the site_perl libs.

The Question

One the modules I need is Digest::MD5. This is a hard module to install, because it has both a pure perl version and a compiled version. I want to bundle the pure perl version, because I don't want my users to have to compile any modules I bundle in.

So, the question is, what's the best way to get a copy of the pure-perl version of Digest::MD5?

My current scheme

At the moment, I fetch all the modules needed by the script.cgi program by making a CPAN bundle, running cpan with "force install My::Bundle in a separate perllib directory on my local machine.

I then delete the directory that has to do with my architecture, example, "darwin-thread-multi-2level", copy all the modules that got downloaded from the bundle into the LIB/perllib directory of my script.cgi program and tar/gzip it up!

So, is this the best way to go about my business? Is there a better way to distribute perl modules that have both compiled and pure-perl versions?

Do you guys bundle CPAN modules into distributed programs in a different way?

 

-justin simoni
skazat me


In reply to Bundling Digest::MD5 with a distributed application? by skazat

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.