directories ahead of those in APPLLIB_EXP by using any of the standard
run-time methods: $PERLLIB, $PERL5LIB, -I, use lib, etc.
+=item USE_SITECUSTOMIZE
+
+Run-time customization of @INC can be enabled with:
+
+ sh Configure -Accflags=-DUSE_SITECUSTOMIZE
+
+When enabled, make perl run F<$sitelibexp/sitecustomize.pl> before
+anything else. This script can then be set up to add additional
+entries to @INC.
+
=item Man Pages
In versions 5.005_57 and earlier, the default was to store module man
my $opt_d = '-d:DProf';
my $t_start = new Benchmark;
- open( R, "$perl \"$opt_d\" $test |" ) || warn "$0: Can't run. $!\n";
+ open( R, "$perl -f \"$opt_d\" $test |" ) || warn "$0: Can't run. $!\n";
@results = <R>;
close R or warn "Could not close: $!";
my $t_total = timediff( new Benchmark, $t_start );
register SV *sv;
register char *s;
char *cddir = Nullch;
+ bool minus_f = FALSE;
PL_fdscript = -1;
PL_suidscript = -1;
sv_catpv(PL_e_script, "\n");
break;
+ case 'f':
+ minus_f = TRUE;
+ s++;
+ goto reswitch;
+
case 'I': /* -I handled both here and in moreswitches() */
forbid_setid("-I");
if (!*++s && (s=argv[1]) != Nullch) {
# ifdef USE_SOCKS
sv_catpv(PL_Sv," USE_SOCKS");
# endif
+# ifdef USE_SITECUSTOMIZE
+ sv_catpv(PL_Sv," USE_SITECUSTOMIZE");
+# endif
# ifdef PERL_IMPLICIT_CONTEXT
sv_catpv(PL_Sv," PERL_IMPLICIT_CONTEXT");
# endif
}
}
+#ifdef USE_SITECUSTOMIZE
+ if (!minus_f) {
+ if (!PL_preambleav)
+ PL_preambleav = newAV();
+ av_unshift(PL_preambleav, 1);
+ (void)av_store(PL_preambleav, 0, Perl_newSVpvf(aTHX_ "BEGIN { do '%s/sitecustomize.pl' }", SITELIB_EXP));
+ }
+#endif
+
if (PL_taint_warn && PL_dowarn != G_WARN_ALL_OFF) {
PL_compiling.cop_warnings = newSVpvn(WARN_TAINTstring, WARNsize);
}
"-d[:debugger] run program under debugger",
"-D[number/list] set debugging flags (argument is a bit mask or alphabets)",
"-e program one line of program (several -e's allowed, omit programfile)",
+"-f don't do $sitelib/sitecustomize.pl at startup",
"-F/pattern/ split() pattern for -a switch (//'s are optional)",
"-i[extension] edit <> files in place (makes backup if extension supplied)",
"-Idirectory specify @INC/#include directory (several -I's allowed)",
commands may be given to build up a multi-line script. Make sure
to use semicolons where you would in a normal program.
+=item B<-f>
+
+Disable executing F<$Config{siteperl}/sitecustomize.pl> at
+startup.
+
+Perl can be built so that it by default will try to execute
+F<$Config{siteperl}/sitecustomize.pl> at startup. 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.
+
=item B<-F>I<pattern>
specifies the pattern to split on if B<-a> is also in effect. The