in reply to Secure deployment of binary perl modules

There are 2 kind of perl modules:

  1. plain text modules (*.pm) like Data::Dumper, etc, that can be deployed in your library path (either the system library path like /usr/local/ActivePerl-5.6/lib/5.6.1, or your own library path which you must include in your script like:
    BEGIN { @INC = (); unshift @INC, '.', '/home/user/perl/lib', "/home/user/perl/lib/sun4- +solaris" if ($^O =~ /solaris/); }
    )
  2. modules that depends on binary files to properly working like DBI, etc, which you need to deploy along with binary files. These can be compiled on a development machine with the same OS as the target machine (Solaris?), then you can copy them via a script, a tar archive or any other means on the target machine as long as you keep the path structure and include the librariy paths into your scripts.

Replies are listed 'Best First'.
Re^2: Secure deployment of binary perl modules
by almut (Canon) on Mar 19, 2007 at 13:50 UTC
    BEGIN { @INC = (); ...

    ...might not be a good idea to clear the @INC array first, because in this case the standard modules will no longer be found (unless you copy all of them into one of the directories specified).

    $ perl -e 'BEGIN{ @INC=(); unshift @INC, ".", "/home/user/perl/lib"} u +se File::Find' Can't locate File/Find.pm in @INC (@INC contains: . /home/user/perl/li +b) at -e line 1. BEGIN failed--compilation aborted at -e line 1.

    In the typical case, you just want to BEGIN{ unshift @INC, ... }, or use lib ... to prepend additional search paths to the system paths that @INC already consists of...

      You're right. I've posted in a hurry :D.