Saturday, July 18, 2009

Perl's sitecustomize.pl

Perl has an option to run sitecustomize.pl very early and regardless of what program is running.

The Configure option to enable this is -Dusesitecustomize. See the INSTALL documentation that comes with the perl source for a brief description. It is not enabled by default.

See perlrun for a brief description of how to prevent execution of this script, if it has been enabled. This P5P thread describes how it works.

ActiveState perl may have this option enabled. It did, but I don't know if it does currently.

Another option is to create a configuration module and use this module when running perl. For example, if you create CONF.pm you can invoke your program as: perl -MCONF program.pl. Alternatively, you can set the environment variable PERL5OPT to include "-MCONF", but note that this option may be processed too late if you are using other -M options on the command line.

No comments:

Labels