develooper Front page | perl.perl5.porters | Postings from April 2010

[PATCH] Improve documentation about

Thread Next
April 27, 2010 09:12
[PATCH] Improve documentation about
Message ID:
This documentation patch is more a rewording of the content of
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) <>
 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}/"; }
+            && do "$Config{sitelib}/";
+    }
+Since it is an actual C<do> (not a C<require>), F<>
+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<>, 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>

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About