Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Self contained Perl environment

by jamsda (Novice)
on Feb 18, 2010 at 18:42 UTC ( #824008=perlquestion: print w/replies, xml ) Need Help??
jamsda has asked for the wisdom of the Perl Monks concerning the following question:

Monks, I'm wondering if its possible to have a self-contained Perl installation for my app that uses its own set of modules outside of the base distribution on a server. Some customers I'm working with don't allow me to install Perl modules on they're server, but I need SOAP::Lite, XML::WRITER and XML::Writer::String which are not currently installed. So I'm thinking taring up my own mini Perl environment with 5.10 and all the modules I need to run in a self-contained environment.

Are there any gotcha's here to consider. Any best ways to go about this so my app only ever uses the Perl I deployed as far as paths? Is is possible to call Perl something like:

Where I install all my stuff to /usr/local/selfcontained/ or wherever..

Thanks... -jim

Replies are listed 'Best First'.
Re: Self contained Perl environment
by linuxer (Curate) on Feb 18, 2010 at 19:15 UTC

    Do you already know pp and PAR::Packer?

    They help you to create a single executable which contains all the stuff of your application to run as a standalone app.

    I think, there are some limitations (especially regarding OS (e.g. Linux <=> WinDOS) and maybe library versions (e.g. glibc), but it may be worth a try.

    I think you have the same limitations, when creating your own environment...

    • reordered modules; replaced PAR with PAR::Packer
    • minor text changes
      ActiveState has a program which packages your executable and environment and will run anyplace. I packaged it on Windows and moved it to a Linux machine and it worked fine. I didn't need to install anything on Linux.
Re: Self contained Perl environment
by GrandFather (Sage) on Feb 19, 2010 at 01:28 UTC
Re: Self contained Perl environment
by aflott (Beadle) on Feb 19, 2010 at 03:58 UTC
    It can be difficult depending upon how many modules you need, their dependencies and the platform you are targeting. Some modules rely on compiled XS code to link to other libraries. You'd have to bundle those as well. If you have relatively few dependencies you can probably get away with compiling Perl non-system @INC, then install all the modules you need and tar up.
Re: Self contained Perl environment
by jamsda (Novice) on Feb 19, 2010 at 21:54 UTC
    Thanks guys for all the suggestions... I will try those out and see what works the best for me. Appreciate all the responses Monks!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://824008]
Approved by sweetblood
Front-paged by ww
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2018-02-21 19:24 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (287 votes). Check out past polls.