$| (dollar sign and
pipe symbol) or $OUTPUT_AUTOFLUSH. This variable is used
to control forcing a flush on a filehandle, be it STDOUT,
a disk file, pipe or socket. For example, to perform non-buffered I/O
to the screen, we would do the following:
A few examples of some of the variables I use the most are listed below:
(Mnemonic: underline is understood in certain operations.)
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.)
$!" to be anything in particular
unless you've gotten a specific error return indicating a system
error.) If used in a string context, yields the corresponding system
error string. You can assign to "$!" in order
to set errno if, for instance, you want
"$!" to return the string for error n,
or you want to set the exit value for the die() operator.
(Mnemonic: What just went bang?)
$0" modifies the
argument area that the ps(1) program sees. This is more
useful as a way of indicating the current program state than it is for
hiding the program you're running. (Mnemonic: same as
sh and ksh.) @ARGV contains the command line arguments
intended for the script. Note that $#ARGV is the
generally number of arguments minus one, since $ARGV[0]
is the first argument, NOT the command name. See
"$0" for the command name. @INC contains the list of places to look for
Perl scripts to be evaluated by the do EXPR ,
require , or use constructs. It initially
consists of the arguments to any -I
command line switches, followed by the default Perl library, probably
"/usr/local/lib/perl", followed by
".", to represent the current directory. %INC
contains entries for each filename that has been included via
do or require . The key is the filename
you specified, and the value is the location of the file actually
found. The require command uses this array to determine
whether a given file has already been included. %ENV contains your current environment. Setting a
value in ENV changes the environment for child processes.