diff options
author | Philippe Bruhat (BooK) <book@cpan.org> | 2010-04-27 18:12:36 +0200 |
---|---|---|
committer | Rafael Garcia-Suarez <rgs@consttype.org> | 2010-04-28 09:42:17 +0200 |
commit | 298ca3548ae8e6060ce762b49f130384169a4093 (patch) | |
tree | 5ca327320512539e2827227a6fc89d3560b1f887 /pod/perlrun.pod | |
parent | 859172fe8e35383381c4d2edab5f0525b3cb42e8 (diff) | |
download | perl-298ca3548ae8e6060ce762b49f130384169a4093.tar.gz |
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) <book@cpan.org>
Signed-off-by: Ævar Arnfjörð Bjarmason <avar@cpan.org>
Diffstat (limited to 'pod/perlrun.pod')
-rw-r--r-- | pod/perlrun.pod | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/pod/perlrun.pod b/pod/perlrun.pod index f510707a41..4905af049f 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> |