The recent node Re: putting perl and modules in your source code repository describes how I build a custom Perl distribution that's distributed with our product.

To defeat the lack of relocatability of perl 5.8.x, mentioned by almut, I ask the user to set an environment variable (YOUR_PRODUCT_HOME, say) and unpack our perl distribution in a well-known sub-directory underneath $YOUR_PRODUCT_HOME. With that done, our custom perl is invoked via a shell wrapper, for example for perl 5.8.6 on solaris the shell wrapper is:

#!/bin/sh if [ -z "$YOUR_PRODUCT_HOME" ]; then echo "error: YOUR_PRODUCT_HOME environment variable is not set." 1> +&2 exit 1 fi $YOUR_PRODUCT_HOME/perl/bin/perl -I"$YOUR_PRODUCT_HOME/perl/lib/5.8.6/ +sun4-solaris" -I"$YOUR_PRODUCT_HOME/perl/lib/5.8.6" -I"$YOUR_PRODUCT_ +HOME/perl/lib/site_perl/5.8.6/sun4-solaris" -I"$YOUR_PRODUCT_HOME/per +l/lib/site_perl/5.8.6" -I"$YOUR_PRODUCT_HOME/perl/lib/site_perl" "$@"

In our next release, I'll upgrade perl to 5.10.x and look forward to eliminating the ugly shell wrapper by taking advantage of its relocation capabilities.

Update: Warning: Note that the shell wrapper above is just a dirty hack that works for me in my environment where the customer just uses the distributed perl as is, and does not install any new modules, for example; it is not a 100% sound relocatable Perl. For that, you'll need perl 5.10.x. To relocate perl 5.8.x more soundly, you might further edit Config.pm and study in detail how perl 5.10.x does it (IIRC, ActiveState has done a relocatable Unix perl 5.8.x for some platforms).


In reply to Re: Howto Bundle Perl (Unix shell wrapper) by eyepopslikeamosquito
in thread Howto Bundle Perl by jameslose

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.