johnnywang has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I've prototyped an application in perl, since this is for an appliance with limited space, I planned to port it to C. However, I'd like to look into the possibility of using perl for this type of situation. The standard distribution with all its packages are too big for my case. How do I build a minumum perl? especially how do I find out which packages/modules I need and only include those? I'd like to even strip some of those core modules if I don't use them. Is there such a tool? Thanks.
  • Comment on How to build a minimum perl, module dependencies

Replies are listed 'Best First'.
Re: How to build a minimum perl, module dependencies
by Kanji (Parson) on Jul 23, 2004 at 19:52 UTC

    You may want to check out micro- and miniperl from the source distribution, although there's a seperate project called TinyPerl, that may be of more interest.

    (I have no idea how small any of those are, only that they exist.)

        --k.


Re: How to build a minimum perl, module dependencies
by valdez (Monsignor) on Jul 23, 2004 at 18:26 UTC
Re: How to build a minimum perl, module dependencies
by pbeckingham (Parson) on Jul 23, 2004 at 18:11 UTC

    1. When you build your Perl from source, configure it, and build it such that features you do not use (threads, for example) are not built.
    2. Having built and installed your Perl, locate the modules you use by searching the code for use Xxxx; statements, and their dependencies, which are all documented, or available by looking in their source. This is not an easy task.
    3. Delete Modules form your installation that you don't use. Be careful, keep backups.

    The better answer is don't bother. Ship an entire standard Perl. The few MB in savings you could get may be outweighed by the task you must undertake to create a minimal Perl.