This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldiag: rewording
[perl5.git] / pod / perlrun.pod
index 570ff65..473205a 100644 (file)
@@ -235,11 +235,13 @@ terminated by the null character, you can say this:
     find . -name '*.orig' -print0 | perl -n0e unlink
 
 The special value 00 will cause Perl to slurp files in paragraph mode.
-The value 0777 will cause Perl to slurp files whole because there is no
-legal byte with that value.
+Any value 0400 or above will cause Perl to slurp files whole, but by convention
+the value 0777 is the one normally used for this purpose.
 
-If you want to specify any Unicode character, use the hexadecimal
-format: C<-0xHHH...>, where the C<H> are valid hexadecimal digits.
+You can also specify the separator character using hexadecimal notation:
+C<-0xHHH...>, where the C<H> are valid hexadecimal digits.  Unlike the octal
+form, this one may be used to specify any Unicode character, even those beyond
+0xFF.
 (This means that you cannot use the C<-x> with a directory name that
 consists of hexadecimal digits.)
 
@@ -299,11 +301,11 @@ STDOUT and STDERR.  Repeating letters is just redundant, not cumulative
 nor toggling.
 
 The C<io> options mean that any subsequent open() (or similar I/O
-operations) will have the C<:utf8> PerlIO layer implicitly applied
-to them, in other words, UTF-8 is expected from any input stream,
-and UTF-8 is produced to any output stream.  This is just the default,
-with explicit layers in open() and with binmode() one can manipulate
-streams as usual.
+operations) in the current file scope will have the C<:utf8> PerlIO layer
+implicitly applied to them, in other words, UTF-8 is expected from any
+input stream, and UTF-8 is produced to any output stream.  This is just
+the default, with explicit layers in open() and with binmode() one can
+manipulate streams as usual.
 
 C<-C> on its own (not followed by any number or option list), or the
 empty string C<""> for the C<PERL_UNICODE> environment variable, has the
@@ -316,7 +318,7 @@ You can use C<-C0> (or C<"0"> for C<PERL_UNICODE>) to explicitly
 disable all the above Unicode features.
 
 The read-only magic variable C<${^UNICODE}> reflects the numeric value
-of this setting.  This is variable is set during Perl startup and is
+of this setting.  This variable is set during Perl startup and is
 thereafter read-only.  If you want runtime effects, use the three-arg
 open() (see L<perlfunc/open>), the two-arg binmode() (see L<perlfunc/binmode>),
 and the C<open> pragma (see L<open>).
@@ -359,6 +361,7 @@ tracing module installed as Devel::foo. E.g., B<-d:DProf> executes
 the program using the Devel::DProf profiler.  As with the B<-M>
 flag, options may be passed to the Devel::foo package where they
 will be received and interpreted by the Devel::foo::import routine.
+Again, like B<-M>, use -d:-foo to call Devel::foo::unimport instead of import.
 The comma-separated list of options must follow a C<=> character.
 If B<t> is specified, it indicates to the debugger that threads
 will be used in the code being debugged.
@@ -396,7 +399,7 @@ B<-D14> is equivalent to B<-Dtls>):
     32768  D  Cleaning up
    131072  T  Tokenising
    262144  R  Include reference counts of dumped variables (eg when using -Ds)
-   524288  J  Do not s,t,P-debug (Jump over) opcodes within package DB
+   524288  J  show s,t,P-debug (don't Jump over) on opcodes within package DB
   1048576  v  Verbose: use in conjunction with other flags
   2097152  C  Copy On Write
   4194304  A  Consistency checks on internal structures
@@ -405,7 +408,8 @@ B<-D14> is equivalent to B<-Dtls>):
  33554432  B  dump suBroutine definitions, including special Blocks like BEGIN
 
 All these flags require B<-DDEBUGGING> when you compile the Perl
-executable (but see L<Devel::Peek>, L<re> which may change this).
+executable (but see C<:opd> in L<Devel::Peek> or L<re/'debug' mode>
+which may change this).
 See the F<INSTALL> file in the Perl source distribution
 for how to do this.  This flag is automatically set if you include B<-g>
 option when C<Configure> asks you about optimizer/debugger flags.
@@ -440,7 +444,7 @@ behaves just like B<-e>, except that it implicitly enables all
 optional features (in the main compilation unit). See L<feature>.
 
 =item B<-f>
-X<-f>
+X<-f> X<sitecustomize> X<sitecustomize.pl>
 
 Disable executing F<$Config{sitelib}/sitecustomize.pl> at startup.
 
@@ -450,6 +454,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>
 
@@ -566,7 +592,7 @@ folks use it for their backup files:
     $ perl -pi~ -e 's/foo/bar/' file1 file2 file3...
 
 Note that because B<-i> renames or deletes the original file before
-creating a new file of the same name, UNIX-style soft and hard links will
+creating a new file of the same name, Unix-style soft and hard links will
 not be preserved.
 
 Finally, the B<-i> switch does not impede execution when no
@@ -946,7 +972,7 @@ locations are automatically included if they exist (this lookup
 being done at interpreter startup time.)
 
 If PERL5LIB is not defined, PERLLIB is used.  Directories are separated
-(like in PATH) by a colon on unixish platforms and by a semicolon on
+(like in PATH) by a colon on Unixish platforms and by a semicolon on
 Windows (the proper path separator being given by the command C<perl
 -V:path_sep>).
 
@@ -978,7 +1004,7 @@ layer specification strings (which is also used to decode the PERLIO
 environment variable) treats the colon as a separator.
 
 An unset or empty PERLIO is equivalent to the default set of layers for
-your platform, for example C<:unix:perlio> on UNIX-like systems
+your platform, for example C<:unix:perlio> on Unix-like systems
 and C<:unix:crlf> on Windows and other DOS-like systems.
 
 The list becomes the default for I<all> perl's IO. Consequently only built-in
@@ -1072,7 +1098,7 @@ buggy in this release.
 
 On all platforms the default set of layers should give acceptable results.
 
-For UNIX platforms that will equivalent of "unix perlio" or "stdio".
+For Unix platforms that will equivalent of "unix perlio" or "stdio".
 Configure is setup to prefer "stdio" implementation if system's library
 provides for fast access to the buffer, otherwise it uses the "unix perlio"
 implementation.
@@ -1097,7 +1123,7 @@ X<PERLIO_DEBUG>
 
 If set to the name of a file or device then certain operations of PerlIO
 sub-system will be logged to that file (opened as append). Typical uses
-are UNIX:
+are Unix:
 
    PERLIO_DEBUG=/dev/tty perl script ...
 
@@ -1248,10 +1274,15 @@ See also hash_seed() of L<Hash::Util>.
 =item PERL_MEM_LOG
 X<PERL_MEM_LOG>
 
-If your perl was compiled with -Accflags=-DPERL_MEM_LOG, setting envar
-PERL_MEM_LOG=1mst writes (m)emory and (s)v debug messages with
-(t)imestamps to stdout(1) instead of stderr(2).  You can write to
-other opened fds too, in a variety of ways;
+If your perl was configured with C<-Accflags=-DPERL_MEM_LOG>, setting
+the environment variable C<PERL_MEM_LOG> enables logging debug
+messages. The value has the form C<< <number>[m][s][t] >>, where
+C<number> is the filedescriptor number you want to write to (2 is
+default), and the combination of letters specifies that you want
+information about (m)emory and/or (s)v, optionally with
+(t)imestamps. For example C<PERL_MEM_LOG=1mst> will log all
+information to stdout. You can write to other opened filedescriptors
+too, in a variety of ways;
 
   bash$ 3>foo3 PERL_MEM_LOG=3m perl ...
 
@@ -1276,7 +1307,7 @@ See L<perlipc/"Deferred Signals (Safe Signals)">.
 X<PERL_UNICODE>
 
 Equivalent to the B<-C> command-line switch.  Note that this is not
-a boolean variable-- setting this to C<"1"> is not the right way to
+a boolean variable. Setting this to C<"1"> is not the right way to
 "enable Unicode" (whatever that would mean).  You can use C<"0"> to
 "disable Unicode", though (or alternatively unset PERL_UNICODE in
 your shell before starting Perl).  See the description of the C<-C>