A new fatal error :
[p5sagit/p5-mst-13.2.git] / pod / perlvar.pod
index bf1d765..571953f 100644 (file)
@@ -769,6 +769,12 @@ The process number of the Perl running this script.  You should
 consider this variable read-only, although it will be altered
 across fork() calls.  (Mnemonic: same as shells.)
 
+Note for Linux users: on Linux, the C functions C<getpid()> and
+C<getppid()> return different values from different threads. In order to
+be portable, this behavior is not reflected by C<$$>, whose value remains
+consistent across threads. If you want to call the underlying C<getpid()>,
+you may use the CPAN module C<Linux::Pid>.
+
 =item $REAL_USER_ID
 
 =item $UID
@@ -863,6 +869,10 @@ from the ps(1) output.  For example, setting C<$0> to C<"foobar"> will
 result in C<"perl: foobar (perl)">.  This is an operating system
 feature.
 
+In multithreaded scripts Perl coordinates the threads so that any
+thread may modify its copy of the C<$0> and the change becomes visible
+to ps(1) (assuming the operating system plays along).
+
 =item $[
 
 The index of the first element in an array, and of the first character
@@ -1003,11 +1013,17 @@ built, as determined during the configuration process.  The value
 is identical to C<$Config{'osname'}>.  See also L<Config> and the 
 B<-V> command-line switch documented in L<perlrun>.
 
+In Windows platforms, $^O is not very helpful: since it is always
+C<MSWin32>, it doesn't tell the difference between
+95/98/ME/NT/2000/XP/CE/.NET.  Use Win32::GetOSName() or
+Win32::GetOSVersion() (see L<Win32> and L<perlport>) to distinguish
+between the variants.
+
 =item ${^OPEN}
 
 An internal variable used by PerlIO.  A string in two parts, separated
-by a C<\0> byte, the first part is the input disciplines, the second
-part is the output disciplines.
+by a C<\0> byte, the first part describes the input layers, the second
+part describes the output layers.
 
 =item $PERLDB
 
@@ -1075,9 +1091,15 @@ regular expression assertion (see L<perlre>).  May be written to.
 
 =item $^S
 
-Current state of the interpreter.  Undefined if parsing of the current
-module/eval is not finished (may happen in $SIG{__DIE__} and
-$SIG{__WARN__} handlers).  True if inside an eval(), otherwise false.
+Current state of the interpreter.
+
+    $^S         State
+    ---------   -------------------
+    undef       Parsing module/eval
+    true (1)    Executing an eval
+    false (0)   Otherwise
+
+The first state may happen in $SIG{__DIE__} and $SIG{__WARN__} handlers.
 
 =item $BASETIME
 
@@ -1089,8 +1111,16 @@ and B<-C> filetests are based on this value.
 
 =item ${^TAINT}
 
-Reflects if taint mode is on or off (i.e. if the program was run with
-B<-T> or not).  True for on, false for off.
+Reflects if taint mode is on or off.  1 for on (the program was run with
+B<-T>), 0 for off, -1 when only taint warnings are enabled (i.e. with
+B<-t> or B<-TU>).  This variable is read-only.
+
+=item ${^UNICODE}
+
+Reflects certain Unicode settings of Perl.  See L<perlrun>
+documentation for the C<-C> switch for more information about
+the possible values. This variable is set during Perl startup
+and is thereafter read-only.
 
 =item $PERL_VERSION
 
@@ -1131,21 +1161,6 @@ related to the B<-w> switch.)  See also L<warnings>.
 The current set of warning checks enabled by the C<use warnings> pragma.
 See the documentation of C<warnings> for more details.
 
-=item ${^WIDE_SYSTEM_CALLS}
-
-Global flag that enables system calls made by Perl to use wide character
-APIs native to the system, if available.  This is currently only implemented
-on the Windows platform.
-
-This can also be enabled from the command line using the C<-C> switch.
-
-The initial value is typically C<0> for compatibility with Perl versions
-earlier than 5.6, but may be automatically set to C<1> by Perl if the system
-provides a user-settable default (e.g., C<$ENV{LC_CTYPE}>).
-
-The C<bytes> pragma always overrides the effect of this flag in the current
-lexical scope.  See L<bytes>.
-
 =item $EXECUTABLE_NAME
 
 =item $^X
@@ -1158,7 +1173,8 @@ a relative or absolute pathname of the perl program file, or may
 be the string used to invoke perl but not the pathname of the
 perl program file.  Also, most operating systems permit invoking
 programs that are not in the PATH environment variable, so there
-is no guarantee that the value of $^X is in PATH.
+is no guarantee that the value of $^X is in PATH.  For VMS, the
+value may or may not include a version number.
 
 You usually can use the value of $^X to re-invoke an independent
 copy of the same perl that is currently running, e.g.,
@@ -1177,10 +1193,10 @@ following statements:
 
 # Build up a set of file names (not command names).
   use Config;
-  use File::Spec;
-  $this_perl = File::Spec->canonpath($^X);
-  $this_perl .= $Config{exe_ext}
-          unless $this_perl =~ m/$Config{exe_ext}$/i;
+  $this_perl = $^X;
+  if ($^O ne 'VMS')
+     {$this_perl .= $Config{_exe}
+          unless $this_perl =~ m/$Config{_exe}$/i;}
 
 Because many operating systems permit anyone with read access to
 the Perl program file to make a copy of it, patch the copy, and
@@ -1191,10 +1207,10 @@ this goal, and produce a pathname that can be invoked as a
 command or referenced as a file.
 
   use Config;
-  use File::Spec;
-  $secure_perl_path = File::Spec->canonpath($Config{perlpath});
-  $secure_perl_path .= $Config{exe_ext}
-          unless $secure_perl_path =~ m/$Config{exe_ext}$/i;
+  $secure_perl_path = $Config{perlpath};
+  if ($^O ne 'VMS')
+     {$secure_perl_path .= $Config{_exe}
+          unless $secure_perl_path =~ m/$Config{_exe}$/i;}
 
 =item ARGV
 
@@ -1218,6 +1234,13 @@ the script.  C<$#ARGV> is generally the number of arguments minus
 one, because C<$ARGV[0]> is the first argument, I<not> the program's
 command name itself.  See C<$0> for the command name.
 
+=item ARGVOUT
+
+The special filehandle that points to the currently open output file
+when doing edit-in-place processing with B<-i>.  Useful when you have
+to do a lot of inserting and don't want to keep modifying $_.  See
+L<perlrun> for the B<-i> switch.
+
 =item @F
 
 The array @F contains the fields of each line read in when autosplit
@@ -1321,6 +1344,10 @@ this:
 
 See L<POSIX>.
 
+The delivery policy of signals changed in Perl 5.8.0 from immediate
+(also known as "unsafe") to deferred, also known as "safe signals".
+See L<perlipc> for more information.
+
 Certain internal hooks can be also set using the %SIG hash.  The
 routine indicated by C<$SIG{__WARN__}> is called when a warning message is
 about to be printed.  The warning message is passed as the first
@@ -1453,18 +1480,19 @@ used safely in programs.  C<$^_> itself, however, I<is> reserved.
 
 Perl identifiers that begin with digits, control characters, or
 punctuation characters are exempt from the effects of the C<package>
-declaration and are always forced to be in package C<main>.  A few
-other names are also exempt:
+declaration and are always forced to be in package C<main>; they are
+also exempt from C<strict 'vars'> errors.  A few other names are also
+exempt in these ways:
 
        ENV             STDIN
        INC             STDOUT
        ARGV            STDERR
-       ARGVOUT
+       ARGVOUT         _
        SIG
 
 In particular, the new special C<${^_XYZ}> variables are always taken
 to be in package C<main>, regardless of any C<package> declarations
-presently in scope.
+presently in scope.  
 
 =head1 BUGS