Perl Cheat Sheet Page 25

ADVERTISEMENT

$ˆI In-place edit extension as passed to Perl using ‘ -i ’.
$ˆL Formfeed character used in formats.
$ˆM Out-of-memory emergency pool.
$ˆP Internal debugging flag.
$ˆT The time (as delivered by
time
) when the program started. This value is used
by the file test operators ‘ -M ’, ‘ -A ’ and ‘ -C ’.
$ˆW The value of the ‘ -w ’ option as passed to Perl.
$ˆX The name by which this Perl interpreter was invoked.
The following variables are context dependent and need not be localized:
The current page number of the currently selected output channel.
$%
$=
The page length of the current output channel. Default is 60 lines.
The number of lines remaining on the page.
$-
The name of the current report format.
The name of the current top-of-page format.
If set to nonzero, forces a flush after every write or print on the output
$|
channel currently selected. Default is 0.
$ARGV The name of the current file when reading from < > .
The following variables are always local to the current block:
The string matched by the last successful pattern match.
$&
The string preceding what was matched by the last successful match.
$‘
The string following what was matched by the last successful match.
$’
The last bracket matched by the last search pattern.
$+
$1 . . . $9 . . . Contain the subpatterns from the corresponding sets of parentheses in
the last pattern successfully matched. $10 and up are only available if the
match contained that many subpatterns.
28. Special arrays
@ARGV Contains the command line arguments for the script (not including the
command name).
@EXPORT
Names the methods a package exports by default.
@EXPORT_OK
Names the methods a package can export upon explicit request.
Contains the list of places to look for Perl scripts to be evaluated by the
@INC
do FILENAME
,
use
and
require
commands.
Do not modify directly, but use the ‘ use lib ’ pragma or -I command
line option instead.
List of base classes of a package.
@ISA
Parameter array for subroutines. Also used by
split
if not in array
@_
context.
%ENV
Contains the current environment.
List of files that have been included with
use
,
require
or
do
.
%INC
Used to set signal handlers for various signals.
%SIG
_ _WARN_ _ and _ _DIE_ _ are pseudo-signals to attach handlers to
Perl warnings and exceptions.
25

ADVERTISEMENT

00 votes

Related Articles

Related forms

Related Categories

Parent category: Education