X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperlvar.pod;h=0248fe07192a52de4d495923623b644611b0a4aa;hb=84287afe68eecc4342d7e27aac5d9df9d2412490;hp=bdf24f6c896fcf026deeab37afa7a7f99ed01e46;hpb=a0d0e21ea6ea90a22318550944fe6cb09ae10cda;p=p5sagit%2Fp5-mst-13.2.git
diff --git a/pod/perlvar.pod b/pod/perlvar.pod
index bdf24f6..0248fe0 100644
--- a/pod/perlvar.pod
+++ b/pod/perlvar.pod
@@ -38,9 +38,9 @@ new value for the FileHandle attribute in question. If not supplied,
most of the methods do nothing to the current value, except for
autoflush(), which will assume a 1 for you, just to be different.
-A few of these variables are considered "read-only". This means that if you
-try to assign to this variable, either directly or indirectly through
-a reference. If you attempt to do so, you'll raise a run-time exception.
+A few of these variables are considered "read-only". This means that if
+you try to assign to this variable, either directly or indirectly through
+a reference, you'll raise a run-time exception.
=over 8
@@ -63,8 +63,49 @@ equivalent:
chop
chop($_)
+Here are the places where Perl will assume $_ even if you
+don't use it:
+
+=over 3
+
+=item *
+
+Various unary functions, including functions like ord() and int(), as well
+as the all file tests (C<-f>, C<-d>) except for C<-t>, which defaults to
+STDIN.
+
+=item *
+
+Various list functions like print() and unlink().
+
+=item *
+
+The pattern matching operations C, C, and C
when used
+without an C<=~> operator.
+
+=item *
+
+The default iterator variable in a C loop if no other
+variable is supplied.
+
+=item *
+
+The implicit iterator variable in the grep() and map() functions.
+
+=item *
+
+The default place to put an input record when a CFHE>
+operation's result is tested by itself as the sole criterion of a C
+test. Note that outside of a C test, this will not happen.
+
+=back
+
(Mnemonic: underline is understood in certain operations.)
+=back
+
+=over 8
+
=item $>
Contains the subpattern from the corresponding set of parentheses in
@@ -139,12 +180,14 @@ Use of "C<$*>" is deprecated in Perl 5.
=item $.
-The current input line number of the last filehandle that was read.
-This variable should be considered read-only.
-Remember that only an explicit close on the filehandle
-resets the line number. Since "CE>" never does an explicit close, line
-numbers increase across ARGV files (but see examples under eof()).
-(Mnemonic: many programs use "." to mean the current line number.)
+The current input line number for the last file handle from
+which you read (or performed a C or on). An
+explicit close on a filehandle resets the line number. Since
+"CE>" never does an explicit close, line numbers increase
+across ARGV files (but see examples under eof()). Localizing C<$.> has
+the effect of also localizing Perl's notion of "the last read
+filehandle". (Mnemonic: many programs use "." to mean the current line
+number.)
=item input_record_separator HANDLE EXPR
@@ -176,12 +219,15 @@ delimit line boundaries when quoting poetry.)
=item $|
If set to nonzero, forces a flush after every write or print on the
-currently selected output channel. Default is 0. Note that STDOUT
-will typically be line buffered if output is to the terminal and block
-buffered otherwise. Setting this variable is useful primarily when you
-are outputting to a pipe, such as when you are running a Perl script
-under rsh and want to see the output as it's happening. (Mnemonic:
-when you want your pipes to be piping hot.)
+currently selected output channel. Default is 0 (regardless of whether
+the channel is actually buffered by the system or not; C<$|> only tells
+you whether you've asked Perl to explicitly flush after each write).
+Note that STDOUT will typically be line buffered if output is to the
+terminal and block buffered otherwise. Setting this variable is useful
+primarily when you are outputting to a pipe, such as when you are running
+a Perl script under rsh and want to see the output as it's happening. This
+has no effect on input buffering.
+(Mnemonic: when you want your pipes to be piping hot.)
=item output_field_separator HANDLE EXPR
@@ -261,9 +307,10 @@ Consider using "real" multi-dimensional arrays in Perl 5.
The output format for printed numbers. This variable is a half-hearted
attempt to emulate B's OFMT variable. There are times, however,
when B and Perl have differing notions of what is in fact
-numeric. Also, the initial value is %.20g rather than %.6g, so you
-need to set "C<$#>" explicitly to get B's value. (Mnemonic: # is the
-number sign.)
+numeric. The initial value is %.Ig, where I is the value
+of the macro DBL_DIG from your system's F. This is different from
+B's default OFMT setting of %.6g, so you need to set "C<$#>"
+explicitly to get B's value. (Mnemonic: # is the number sign.)
Use of "C<$#>" is deprecated in Perl 5.
@@ -370,6 +417,18 @@ to "C<$!>" in order to set I if, for instance, you want "C<$!>" to return
string for error I, or you want to set the exit value for the die()
operator. (Mnemonic: What just went bang?)
+=item $EXTENDED_OS_ERROR
+
+=item $^E
+
+More specific information about the last system error than that
+provided by C<$!>, if available. (If not, it's just C<$!> again.)
+At the moment, this differs from C<$!> only under VMS, where it
+provides the VMS status value from the last system error. The
+caveats mentioned in the description of C<$!> apply here, too.
+(Mnemonic: Extra error explanation.)
+
+
=item $EVAL_ERROR
=item $@
@@ -379,6 +438,9 @@ last eval() parsed and executed correctly (although the operations you
invoked may have failed in the normal fashion). (Mnemonic: Where was
the syntax error "at"?)
+Note that warning messages are not collected in this variable. You can,
+however, set up a routine to process warnings by setting $SIG{__WARN__} below.
+
=item $PROCESS_ID
=item $PID
@@ -440,7 +502,8 @@ you, if you're running setgid.)
Note: "C<$E>", "C<$E>", "C<$(>" and "C<$)>" can only be set on machines
that support the corresponding I routine. "C<$(>" and "C<$)>"
-can only be swapped on machines supporting setregid().
+can only be swapped on machines supporting setregid(). Because Perl doesn't
+currently use initgroups(), you can't set your group vector to multiple groups.
=item $PROGRAM_NAME
@@ -468,7 +531,9 @@ discouraged.
=item $]
-The string printed out when you say C. It can be used to
+The string printed out when you say C.
+(This is currently I).
+It can be used to
determine at the beginning of a script whether the perl interpreter
executing the script is in the right range of versions. If used in a
numeric context, returns the version + patchlevel / 1000. Example:
@@ -504,6 +569,11 @@ closed before the open() is attempted.) Note that the close-on-exec
status of a file descriptor will be decided according to the value of
C<$^F> at the time of the open, not the time of the exec.
+=item $^H
+
+The current set of syntax checks enabled by C