Re: [PATCH] perl573delta delinting
[p5sagit/p5-mst-13.2.git] / pod / perlvar.pod
index bf1d765..258645e 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
@@ -1003,11 +1009,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
 
@@ -1158,7 +1170,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 +1190,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 +1204,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 +1231,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
@@ -1453,8 +1473,9 @@ 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
@@ -1464,7 +1485,7 @@ other names are also exempt:
 
 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