I develop cross-platform Perl (Tk) applications. Most of the people running my applications don't have perl installed, so I bundle a minimal distribution of perl with all my releases. These usually end up between 5 and 10 MB depending upon the platform and modules used. The trick is figuring out exactly what parts of perl are needed. How do other monks solve this?

I'm not interested in encrypting or obscuring source code -- all my bundled Perl code is exactly the same as what I edit (commented, indented, etc.) I'm also not interested in archive formats or single binary executables.

Here are the two techniques I use.

The first uses brute force testing on a specially prepared perl install. After doing a normal kitchen-sink build and install, I run a Unix "touch" command to reset the last access times of all the files to Jan 1, 2000. Then I run my application (and test suite) to excercise every possible function. Finally I use a Unix "find" command to find all the files that have been accessed. This works well (even for Windows if I use Samba), but sometimes I miss autoloaded files if my testing script is incomplete. (Keyboard control of Tk scrollbars for example. Argh!)

My other technique adds a tracer subroutine to @INC that logs every require'd module. This works ok, but I have to guess what files were actually loaded based on the module name. Usually I grab entire directories containing shared object libraries and autoload files. I'm sure this technique is not generating minimal installs.


In reply to How to minimize size of perl install? by blssu

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.