From: Philippe Bruhat (BooK) Date: Tue, 27 Apr 2010 16:12:36 +0000 (+0200) Subject: Improve documentation about sitecustomize.pl. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=298ca3548ae8e6060ce762b49f130384169a4093;p=p5sagit%2Fp5-mst-13.2.git Improve documentation about sitecustomize.pl. This documentation patch is more a rewording of the content of http://www.nntp.perl.org/group/perl.perl5.porters/2007/10/msg129930.html than anything original. The actual authors are therefore Michael G Schwern, Jan Dubois, Peter Dintelmann, and H.Merijn Brand. Signed-off-by: Philippe Bruhat (BooK) Signed-off-by: Ævar Arnfjörð Bjarmason --- diff --git a/pod/perlrun.pod b/pod/perlrun.pod index f510707..4905af0 100644 --- a/pod/perlrun.pod +++ b/pod/perlrun.pod @@ -450,6 +450,28 @@ This is a hook that allows the sysadmin to customize how perl behaves. It can for instance be used to add entries to the @INC array to make perl find modules in non-standard locations. +Perl actually inserts the following code: + + BEGIN { + do { local $!; -f "$Config{sitelib}/sitecustomize.pl"; } + && do "$Config{sitelib}/sitecustomize.pl"; + } + +Since it is an actual C (not a C), F +doesn't need to return a true value. The code is run in package C
, +in its own lexical scope. However, if the script dies, C<$@> will not +be set. + +The value of C<$Config{sitelib}> is also determined in C code and not +read from C, which is not loaded. + +The code is executed B early. For example, any changes made to +C<@INC> will show up in the output of `perl -V`. Of course, C +blocks will be likewise executed very late. + +To determine at runtime if this capability has been compiled in your +perl, you can check the value of C<$Config{usesitecustomize}>. + =item B<-F>I X<-F>