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) <book@cpan.org> --- pod/perlrun.pod | 22 ++++++++++++++++++++++ 1 files changed, 22 insertions(+), 0 deletions(-) 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<do> (not a C<require>), F<sitecustomize.pl> +doesn't need to return a true value. The code is run in package C<main>, +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<Config.pm>, which is not loaded. + +The code is executed B<very> early. For example, any changes made to +C<@INC> will show up in the output of `perl -V`. Of course, C<END> +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<pattern> X<-F> -- 1.6.0.3.517.g759aThread Next