=head2 Predefined Names
The following names have special meaning to Perl. Most
-punctuation names have reasonable mnemonics, or analogues in one of
-the shells. Nevertheless, if you wish to use long variable names,
-you just need to say
+punctuation names have reasonable mnemonics, or analogs in the
+shells. Nevertheless, if you wish to use long variable names,
+you need only say
use English;
HANDLE->method(EXPR)
-Each of the methods returns the old value of the IO::Handle attribute.
+Each method returns the old value of the IO::Handle attribute.
The methods each take an optional EXPR, which if supplied specifies the
new value for the IO::Handle attribute in question. If not supplied,
-most of the methods do nothing to the current value, except for
+most methods do nothing to the current value--except for
autoflush(), which will assume a 1 for you, just to be different.
-It costs quite a bit to load in the IO::Handle class, so you should
+Because loading in the IO::Handle class is an expensive operation, you should
learn how to use the regular built-in variables.
A few of these variables are considered "read-only". This means that if
a reference, you'll raise a run-time exception.
The following list is ordered by scalar variables first, then the
-arrays, then the hashes (except $^M was added in the wrong place).
-This is somewhat obscured by the fact that %ENV and %SIG are listed as
-$ENV{expr} and $SIG{expr}.
+arrays, then the hashes.
=over 8
The default place to put an input record when a C<E<lt>FHE<gt>>
operation's result is tested by itself as the sole criterion of a C<while>
-test. Outside of a C<while> test, this will not happen.
+test. Outside a C<while> test, this will not happen.
=back
$+[0] - $-[0]>. Similarly, C<$>I<n> coincides with C<substr $_, $-[>I<n>C<],
$+[>I<n>C<] - $-[>I<n>C<]> if C<$-[>I<n>C<]> is defined, and $+ coincides with
C<substr $_, $-[$#-], $+[$#-]>. One can use C<$#+> to find the number
-of subgroups in the last successful match. Note the difference with
-C<$#->, which is the last I<matched> subgroup. Compare with C<@->.
+of subgroups in the last successful match. Contrast with
+C<$#->, the last I<matched> subgroup. Compare with C<@->.
=item $MULTILINE_MATCHING
=item $.
The current input record number for the last file handle from which
-you just read() (or performed a C<seek> or C<tell> on). The value
+you just read() (or called a C<seek> or C<tell> on). The value
may be different from the actual physical line number in the file,
depending on what notion of "line" is in effect--see C<$/> on how
to change that. An explicit close on a filehandle resets the line
number. Because C<E<lt>E<gt>> never does an explicit close, line
numbers increase across ARGV files (but see examples in L<perlfunc/eof>).
Consider this variable read-only: setting it does not reposition
-the seek pointer; you'll have to do that on your own. (Mnemonic:
-many programs use "." to mean the current line number.)
+the seek pointer; you'll have to do that on your own. 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
=item $/
-The input record separator, newline by default. This is used to
-influence Perl's idea of what a "line" is. Works like B<awk>'s RS
+The input record separator, newline by default. This
+influences Perl's idea of what a "line" is. Works like B<awk>'s RS
variable, including treating empty lines as a terminator if set to
-the null string. (Note: An empty line cannot contain any spaces
-or tabs.) You may set it to a multi-character string to match a
+the null string. (An empty line cannot contain any spaces
+or tabs.) You may set it to a multi-character string to match a
multi-character terminator, or to C<undef> to read through the end
of file. Setting it to C<"\n\n"> means something slightly
different than setting to C<"">, if the file contains consecutive
empty lines. Setting to C<""> will treat two or more consecutive
empty lines as a single empty line. Setting to C<"\n\n"> will
blindly assume that the next input character belongs to the next
-paragraph, even if it's a newline. (Mnemonic: / is used to delimit
+paragraph, even if it's a newline. (Mnemonic: / delimits
line boundaries when quoting poetry.)
undef $/; # enable "slurp" mode
so it's best not to mix record and non-record reads on the same
file. (This is unlikely to be a problem, because any file you'd
want to read in record mode is probably usable in line mode.)
-Non-VMS systems perform normal I/O, so it's safe to mix record and
+Non-VMS systems do normal I/O, so it's safe to mix record and
non-record reads of a file.
-Also see C<$.>.
+See also L<perlport/"Newlines">. Also see C<$.>.
=item autoflush HANDLE EXPR
If set to nonzero, forces a flush right away and after every write
or print on the currently selected output channel. Default is 0
-(regardless of whether the channel is actually buffered by the
+(regardless of whether the channel is really buffered by the
system or not; C<$|> tells you only whether you've asked Perl
explicitly to flush after each write). STDOUT will
typically be line buffered if output is to the terminal and block
The output format for printed numbers. This variable is a half-hearted
attempt to emulate B<awk>'s OFMT variable. There are times, however,
-when B<awk> and Perl have differing notions of what is in fact
+when B<awk> and Perl have differing notions of what counts as
numeric. The initial value is "%.I<n>g", where I<n> is the value
of the macro DBL_DIG from your system's F<float.h>. This is different from
B<awk>'s default OFMT setting of "%.6g", so you need to set C<$#>
$+[0] - $-[0]>. Similarly, C<$>I<n> coincides with C<substr $_, $-[>I<n>C<],
$+[>I<n>C<] - $-[>I<n>C<]> if C<$-[>I<n>C<]> is defined, and $+ coincides with
C<substr $_, $-[$#-], $+[$#-]>. One can use C<$#-> to find the last
-matched subgroup in the last successful match. Note the difference with
-C<$#+>, which is the number of subgroups in the regular expression. Compare
+matched subgroup in the last successful match. Contrast with
+C<$#+>, the number of subgroups in the regular expression. Compare
with C<@+>.
=item format_name HANDLE EXPR
=item $~
The name of the current report format for the currently selected output
-channel. Default is name of the filehandle. (Mnemonic: brother to
+channel. Default is the name of the filehandle. (Mnemonic: brother to
C<$^>.)
=item format_top_name HANDLE EXPR
=item $^
The name of the current top-of-page format for the currently selected
-output channel. Default is name of the filehandle with _TOP
+output channel. Default is the name of the filehandle with _TOP
appended. (Mnemonic: points to top of page.)
=item format_line_break_characters HANDLE EXPR
=item $^L
-What formats output to perform a form feed. Default is \f.
+What formats output as a form feed. Default is \f.
=item $ACCUMULATOR
The current value of the write() accumulator for format() lines. A format
contains formline() calls that put their result into C<$^A>. After
calling its format, write() prints out the contents of C<$^A> and empties.
-So you never actually see the contents of C<$^A> unless you call
+So you never really see the contents of C<$^A> unless you call
formline() yourself and then look at it. See L<perlform> and
L<perlfunc/formline()>.
successful call to wait() or waitpid(), or from the system()
operator. This is just the 16-bit status word returned by the
wait() system call (or else is made up to look like it). Thus, the
-exit value of the subprocess is actually (C<$? E<gt>E<gt> 8>), and
+exit value of the subprocess is really (C<$? E<gt>E<gt> 8>), and
C<$? & 127> gives which signal, if any, the process died from, and
C<$? & 128> reports whether there was a core dump. (Mnemonic:
similar to B<sh> and B<ksh>.)
Additionally, if the C<h_errno> variable is supported in C, its value
-is returned via $? if any of the C<gethost*()> functions fail.
+is returned via $? if any C<gethost*()> function fails.
If you have installed a signal handler for C<SIGCHLD>, the
value of C<$?> will usually be wrong outside that handler.
($<,$>) = ($>,$<); # swap real and effective uid
(Mnemonic: it's the uid you went I<to>, if you're running setuid.)
-Note: C<$E<lt>> and C<$E<gt>> can be swapped only on machines
+C<$E<lt>> and C<$E<gt>> can be swapped only on machines
supporting setreuid().
=item $REAL_GROUP_ID
which may be the same as the first number.
Similarly, a value assigned to C<$)> must also be a space-separated
-list of numbers. The first number is used to set the effective gid, and
+list of numbers. The first number sets the effective gid, and
the rest (if any) are passed to setgroups(). To get the effect of an
empty list for setgroups(), just repeat the new effective gid; that is,
to force an effective gid of 5 and an effectively empty setgroups()
(Mnemonic: parentheses are used to I<group> things. The effective gid
is the group that's I<right> for you, if you're running setgid.)
-Note: C<$E<lt>>, C<$E<gt>>, C<$(> and C<$)> can be set only on
+C<$E<lt>>, C<$E<gt>>, C<$(> and C<$)> can be set only on
machines that support the corresponding I<set[re][ug]id()> routine. C<$(>
and C<$)> can be swapped only on machines supporting setregid().
The current value of the warning switch, initially true if B<-w>
was used, false otherwise, but directly modifiable. (Mnemonic:
-related to the B<-w> switch.) See also L<warning>.
+related to the B<-w> switch.) See also L<warnings>.
+
+=item ${^Warnings}
+
+The current set of warning checks enabled by the C<use warnings> pragma.
+See the documentation of C<warnings> for more details.
=item $EXECUTABLE_NAME
=item @ARGV
The array @ARGV contains the command-line arguments intended for
-the script. C<$#ARGV> is the generally number of arguments minus
+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.
The hash %INC contains entries for each filename included via the
C<do>, C<require>, or C<use> operators. The key is the filename
you specified (with module names converted to pathnames), and the
-value is the location of the file actually found. The C<require>
-operator uses this array to determine whether a particular file has
+value is the location of the file found. The C<require>
+operator uses this hash to determine whether a particular file has
already been included.
=item %ENV
=item $SIG{expr}
-The hash %SIG is used to set signal handlers for various
-signals. For example:
+The hash %SIG contains signal handlers for signals. For example:
sub handler { # 1st argument is signal name
my($sig) = @_;
not available.
See L<perlfunc/die>, L<perlfunc/warn>, L<perlfunc/eval>, and
-L<warning> for additional information.
+L<warnings> for additional information.
=back
Under a few operating systems, C<$^E> may contain a more verbose
error indicator, such as in this case, "CDROM tray not closed."
-Systems that do not support extended error mesages leave $C<$^E>
+Systems that do not support extended error messages leave C<$^E>
the same as C<$!>.
Finally, C<$?> may be set to non-0 value if the external program
control-C<W>. This is better than typing a literal control-C<W>
into your program.
-Finally, new in Perl 5.006, Perl variable names may be alphanumeric
+Finally, new in Perl 5.6, Perl variable names may be alphanumeric
strings that begin with control characters (or better yet, a caret).
These variables must be written in the form C<${^Foo}>; the braces
are not optional. C<${^Foo}> denotes the scalar variable whose