Rex Swain's HTMLified | Perl 5 Reference Guide | adapted by Dennis German |
fixed | denotes literal text. | word | is a keyword, i.e., a word with a special meaning. |
THIS | means variable text, i.e., things you must fill in. | RETURN key | denotes pressing a keyboard key. |
THIS£ | means that THIS will default to $_ if omitted.
| […] | denotes an optional part. |
'abc' except \' and \\ | No $variable or escape sequences intreptation | |
q/abc/ Almost any pair of delimiters can be used instead of / …/ .
| ||
"abc"
| $variables are intrepreted and escape sequences are processed. | |
qq/abc/ .
| ||
` command` | evaluates to the output of the |
\t
(Tab), \n
(Newline),
\r
(Return), \f
(Formfeed),
\b
(Backspace), \a
(Alarm aka beep),\033
(octal), \x1b
(hex),\e
(Escape),\c[
(control) \l
and \u
lowercase/uppercase the following character.\L
and \U
lowercase/uppercase until a \E
is encountered.\Q
quote regular expression characters until a \E
is encountered.
123
, 1_234
†,
1.234
, 5E-10
, 0xff
(hex), 0377
(leading zero implies octal)
$var | simple scalar |
$var[28] | 29th element of array @var .
|
$p = \@var | now $p is a reference to array @var .
|
$$p[28] $p->[28] | 29th element of array referenced by $p .
|
$var[-1] | last element of array @var .
|
$var[$i][$j] | $j th element of the $i th element of array @var .
|
$#var | last index of array @var .
|
@var | the entire array. In a scalar context, the number of elements in the array. |
@var[3,4,5] | a slice of array @var .
|
@var{'a','b'} | a slice of %var ;
|
%var | the entire hash. In a scalar context, true if the hash has elements.
|
$var{'Feb'} | a value from hash %var .
|
$p = \%var | now $p is a reference to hash %var
|
$p->{'Feb'} . $$p{'Feb'} | a value from hash referenced by $p
|
$var{'a',1, …} | emulates a multidimensional array. |
('a' …'z')[4,7,9] | a slice of an array literal. |
PKG:: var | a variable from a package, e.g., $pkg::var , @pkg::ary .
|
\ OBJECT | reference to an object, e.g., \$var , \%hash .
|
* NAME | refers to all objects represented by NAME. *n1 = *n2 makes n1 an alias for n2 . *n1 = $n2 makes $n1 an alias for $n2 .
|
Array@values(1, 2, 3) @values(1..4) aka @values(1,2,3,4) @values('a'..'z') @values qw/foo bar …/ is the same as
Array reference$value[1,2,3]
|
Hash (associative array)
initalze:
reference:$myhash{ KEY1, val1, KEY2, val2, …}
|
Use a {
block
}
to return the correct type of reference instead of the variable identifier,
Example:
${
…}
,
&{
…}
.
$$p
is a shorthand for ${$p}
.
** | Exponentiation | |||||||||
+ - * / | Addition, subtraction, multiplication, division | |||||||||
% | Modulo division i.e. remainder | |||||||||
& | ^ | Bitwise AND, OR, exclusiveOR | |||||||||
>> | << | Bitwise shift right, left | ||||||||
|| | && | Logical OR, AND | ||||||||
. | string Concatenation | |||||||||
x | left operand (an array or a string) repeated the number of times specified right operand | |||||||||
All of the above operators also have an assignment operator, e.g., .=
| ||||||||||
-> | Dereference operator | |||||||||
\ | Reference (unary) | |||||||||
! | ~ | Negation (unary), bitwise complement (unary) | ||||||||
++ | -- | Auto-increment (magical on strings), auto-decrement | ||||||||
Logical operators return 1 for true ( So don't use $xxPresent=true; ) | ||||||||||
Numeric | String | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
== | != | equality, inequality | eq | ne
| ||||||
< | > | less than, greater than | lt | gt
| ||||||
<= | >= | less (greater) than or equal to | le | ge
| ||||||
<=> | compare. Returns -1, 0, 1. | cmp
| ||||||||
=~ | !~ | negate Search pattern, substitution, or translation | ||||||||
.. | Range (scalar context) , enumeration (array context) | |||||||||
?: | Alternation (if-then-else) | |||||||||
, | Comma operator, also list element separator. | |||||||||
=> | Comma operator, also list element separator. | |||||||||
not | Low-precedence negation | |||||||||
and | Low-precedence AND | |||||||||
or | xor | Low-precedence OR, exclusiveOR |
All functions can be used as list operators, in which case
they have very high or very low precedence, depending on
whether you look at the left or the right side of the operator.
Operators not
, and
, or
and xor
have lower precedence.
A "list" is a list of expressions, variables, or lists.
An array variable or an array slice may be used instead of a list.
Parentheses clarify precedence.
A statement is an expression, optionally followed by a modifier, terminated by a semicolon.
The semicolon may be omitted if the statement is the final one in a block
.
block
when enclosed in {}
. Execution of expressions can depend on other expressions using a modifier.
expr1
if
expr2
;
expr1
unless
expr2
;
expr1
unless
expr2
;
expr1
while
expr2
;
do
block
while
expr
;
do
block
until
expr
;
Conditional execution: logical operators
expr1
||
expr2
;
expr1
2|
expr2
;
expr1
?
expr2
:
expr3
;
if (expr) block
[ [ elsif (expr) block
… ]
else block
]
unless (expr) block
[ else
block
] label
:
]
while
((expr)
) block
[ continue
block
] label
:
]
until
((expr)
) block
[ continue
block
] label
:
]
for (expr; expr; expr) block
label
:
]
foreach var
£ (list
) block
label
:
]
block
[ continue
block
]
Program flow can be controlled with:
goto label | |
last [ label ] | Immediately exits the loop in question. Skips continue block. |
next [ label ] | Starts the next iteration of the loop. |
redo [ label ] | Restarts the loop block without evaluating the conditional again. |
which are guaranteed to perform block
once before testing expr
, and
do
block
which turns block
into an expression.
do f
, require f
, or use f
sub name {
aka
@arrayOfAllArgs@_;
aka
$firstArg $_[1]; $_[2]
aka xxx;… ;
statments;
return }
&SUBROUTINE LIST | Executes a SUBROUTINE declared by sub , and returns the value of the last expression evaluated in SUBROUTINE.SUBROUTINE can be an expression yielding a reference to a code object. The & may be omitted if the subroutine has been declared before being used.
| ||||||||||||||||||||||||||||
sub] BEGIN { | Defines a setup block called before execution.
| ||||||||||||||||||||||||||||
[sub] END { |
sub
{
STATEMENTS}
fhs:
STDIN
, STDOUT
, STDERR
, ARGV
, DATA
.
User-specified: HANDLE, $
var.
Globs:
<pattern>
evaluates to all filenames according to the pattern.
Use <${
var}>
or glob
$
var to glob from a variable.
Here-Is:
<<
identifier
Shell-style "here document."
Special tokens:
__FILE__
: filename;
__LINE__
: line number;
__END__
: end of program;
remaining lines can be read using the fh DATA
.
Perl rules of object oriented programming:
@ISA
are searched.
Methods can be applied with:
->
METHOD PARAMETERS
use List::Util qw(
reduce any all none notall first max maxstr min minstr product sum sum0
pairs unpairs pairkeys pairvalues pairfirst pairgrep pairmap shuffle uniq uniqnum uniqstr
);
exp expr£ | e expr
| sin expr£ | sine in radians | |||||||||||||||||||||
log expr£ | natural logarithm (base e )
| cos expr£ | cosine in radians | |||||||||||||||||||||
sqrt expr£ | square root | atan2 y |
localtime expr
£ Converts a time as returned by the time
function to
ctime
(3) string. Sun Aug 15 20:26:21 2010
In array context, returns a 9-element array with the time analyzed for the local time zone.
$mon
has the range 0..11 and
$wday
has the range 0..6.
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); ## for display and log name
xx
$month=(January,February,March,April,May,June,July,August,September,October,November,December)[$mon];
if ($mday< 10) { $mday= "0$mday" }; if (++$mon< 10) { $mon= "0$mon" }; $year = 1900 + $year;
if ($hour< 10) { $hour= "0$hour" }; if ( $min< 10) { $min= "0$min" }; if ( $sec< 10) { $sec = "0$sec" };
gmtime
expr£ Converts a time as returned by the time
function to a 9-element array Greenwich
chr
£ Returns the character represented by the decimal value expr
expr
.
hex
£ Returns the decimal value of expr
expr
interpreted as a hex string.
oct
£ Returns the decimal value of expr
expr
interpreted as an octal string.
expr
s begining with 0x
are intrepreted as hexidecimal.
ord
expr£ Returns the ASCII value of the first character of expr
.
vec
expr
,
offset,
bits
Treats string expr
as a vector of unsigned integers, and yields the bit at offset.
bits must be between 1 and 32.
May be assigned to.
pack template, list
| Packs the values into a binary structure using template. |
unpack template, expr
| Unpacks the structure expr into an array, using template.
|
TEMPLATE is a sequence of characters as follows:
a | A | ASCII string, null- | space-padded |
b | B
| Bit string in ascending | descending order |
c | C | Native | unsigned char value |
f | d | Single | double float in native format |
h | H | Hex string, low | high nybble first |
i | I | Signed | unsigned integer value |
l | L | Signed | unsigned long value |
n | N | Short | long in network (big endian) byte order |
s | S | Signed | unsigned short value |
u | P | Uuencoded string | pointer to a string |
v | V | Short | long in VAX (little endian) byte order |
x | @ | Null byte | null fill until position |
X | Backup a byte |
Character may be followed by a decimal repeat count; an asterisk (*
) specifies all
remaining arguments.
If the format is preceded with %
N, unpack
returns an N-bit checksum instead.
Spaces may be included in the template for readability purposes.
chomp list£
|
use List::Util qw(first max maxstr min minstr reduce shuffle sum);
delete $HASH |
Each character matches itself, except + ? . * ^ $ ( ) [ ] { } | \
.
The special meaning of these characters is escaped using a \
.
. | matches any character, but not a newline
unless it is a single-line match (see m//s ).
| ||||||||||||||||||||||||||||
( …) | groups a series of pattern elements to a single element. | ||||||||||||||||||||||||||||
^ | matches the beginning of the target. In multiline mode (see m//m ) also matches after every newline character.
| ||||||||||||||||||||||||||||
$ | matches the end of the line. In multiline mode also matches before every newline character. | ||||||||||||||||||||||||||||
[ … ] | denotes a class of characters to match.
[^ … ] negates the class.
| ||||||||||||||||||||||||||||
( … | … | … )
| matches one of the alternatives. | ||||||||||||||||||||||||||||
(?# comment )
| |||||||||||||||||||||||||||||
(?: REGEXP ) | does not make back-references. | ||||||||||||||||||||||||||||
(?= REGEXP ) | Zero width positive look-ahead assertion. | ||||||||||||||||||||||||||||
(?! REGEXP ) | Zero width negative look-ahead assertion. | ||||||||||||||||||||||||||||
(? MODIFIER )
| Embedded pattern-match modifier. MODIFIER can be one or more of
i , m , s , or x .
| ||||||||||||||||||||||||||||
Quantified subpatterns match as many times as possible. When followed with a ? they match the minimum number of times.
These are the quantifiers: | |||||||||||||||||||||||||||||
+ | matches the preceding pattern element one or more times. | ||||||||||||||||||||||||||||
? | matches zero or one times. i.e. not more than one. | ||||||||||||||||||||||||||||
* | matches zero or more times. | ||||||||||||||||||||||||||||
{ N, M}
| at least N and no more than M matchs ( do not escape the { as with a command like grep)
| ||||||||||||||||||||||||||||
{ N} | means exactly N times | ||||||||||||||||||||||||||||
{ N, } | at least N times. | ||||||||||||||||||||||||||||
A \ escapes special meaning of the following character if non-alphanumeric,A \ Introduces special usage for: | |||||||||||||||||||||||||||||
\w | matches alphanumeric, including _ , \W matches non-alphanumeric.
| ||||||||||||||||||||||||||||
\s | matches whitespace, \S matches non-whitespace.
| ||||||||||||||||||||||||||||
\d | matches digit, \D matches non-digit.
| ||||||||||||||||||||||||||||
\A \Z |
Variables local to the current block: | |
$` | string preceding |
$& | string matched by the last successful pattern match. |
$' | string following |
$+ | last bracket matched by the last search pattern. |
$1 …$9…
$10 … and up (only available if Contain subpatterns from the corresponding sets of parentheses in the
last pattern successfully matched.)
|
With modifier x
, whitespace can be used in the patterns for readability purposes.
expr =~ ] [m ] /pattern/ g ][i ][m ][o ][s ][x ] | Matches expr (default: $_ ) for pattern . Leading m permits use of alternate of delimiters.In array context, an array is returned consisting of the subexpressions matched by the parentheses in the pattern,
If pattern is empty, the most recent pattern from a previous match or replacement is used. With g the match can be used as an iterator in scalar context.
| ||||||||
pos scalar |
$_
), filename or fh._
(underscore) is passed, information is from the preceding test or stat
.
-r -w -x | readable/writable/executable by effective uid/gid. |
-R -W -X | readable/writable/executable by real uid/gid. |
-o -O | owned by effective/real uid. |
-e -z | exists/has zero size. |
-s | exists and has non-zero size. Returns the size. |
-f -d | a plain file/ directory. |
-l -S -p | a symbolic link/ socket/ named pipe (FIFO). |
-b -c | a block/character special file. |
-u -g -k | setuid/setgid/sticky bit set. |
-t | fh (STDIN by default) is opened to a tty.
|
-T -B | text/non-text (binary) file. Return true on a null file, or a file at EOF when testing a fh.
|
-M -A -C | File modification / access / inode-change time. Measured in days. Value returned reflects the file age at the time the script started. See also $^T
Special Variables.
|
chmod list | Changes the permissions of a list of files. The first element of the list must be the numerical mode. | ||||||||
chown list | Changes the owner and group of a list of files. The first two elements of the list must be the numerical uid and gid. | ||||||||
truncate file , size
| Truncates file tosize . file may be a filename or a fh.
| ||||||||
mkdir DIR, MODE | makes a directory with given permissions.(MODE)
Sets $!
| ||||||||
rmdir filename£ | removes the directory if it is empty. Sets $!
| ||||||||
stat file
| Returns:
($ dev, $ ino, $ mode, $ nlink, $ uid,
$ gid, $ rdev, $ size, $ atime, $ mtime,
$ ctime, $ blksize, $ blocks).
| ||||||||
lstat file | Like stat , but does not traverse a final symbolic link.
file can be a fh, an expression evaluating to a filename,
or _ to refer to the last file test operation or stat call.
Returns a null list if the stat fails.
| ||||||||
|
fh
may be stdin
| stdout
STDOUT
) ,
open
fh
.
|
formline
PICTURE,
list
list
according to PICTURE
and accumulates the result into $^A
.
write
[ fh
]
Writes a formatted record to the specified file, using the format associated with that file.
Formats are defined as:
format
[NAME] =
.
FORMLIST pictures the lines, and contains the arguments which will
give values to the fields in the lines. NAME defaults STDOUT
Picture fields are:
@<<< …
| left adjusted field, repeat the < to denote the desired width
|
@>>> …
| right adjusted field |
@||| …
| centered field |
@#.## …
| numeric format with implied decimal point |
@*
| a multi-line field |
^
instead of @
for multiline block filling.~
at the beginning of a line to suppress unwanted empty lines.~~
at the beginning of a line to have this format line repeated until
all fields are exhausted.$-
to zero to force a page break on the next write
.$^
, $~
, $^A
, $^F
,
$-
and $=
Special Variables.
opendir DIRHANDLE, DIRNAME | Opens a directory on the handle specified. |
closedir DIRHANDLE | Closes a directory opened by opendir .
|
readdir DIRHANDLE | Returns the next entry (or an array of entries) from the directory. |
rewinddir DIRHANDLE | Positions the directory to the beginning. |
seekdir DIRHANDLE, pos | Sets position for readdir on the directory.
|
telldir DIRHANDLE | Returns the position in the directory. |
alarm secs |
accept NEWSOCKET GENERICSOCKET | Accepts a new socket. |
bind SOCKET NAME | Binds the NAME to the SOCKET. |
connect SOCKET NAME | Connects the NAME to the SOCKET. |
getpeername SOCKET | Returns the socket address of the other end of the SOCKET. |
getsockname SOCKET | Returns the name of the SOCKET. |
getsockopt SOCKET LEVEL OPTNAME | Returns the socket options. |
listen SOCKET QUEUESIZE | Starts listening on the specified SOCKET. |
recv SOCKET SCALAR LENGTH FLAGS | Receives a message on SOCKET. |
send SOCKET MSG FLAGS [ TO ] | Sends a message on the SOCKET. |
setsockopt SOCKET LEVEL OPTNAME OPTVAL | Sets the requested socket option. |
shutdown SOCKET HOW | Shuts down a SOCKET. |
socket SOCKET DOMAIN TYPE PROTOCOL | Creates a SOCKET in DOMAIN with TYPE and PROTOCOL. |
socketpair SOCKET1 SOCKET2 DOMAIN TYPE PROTOCOL | Creates a pair of bidirectional sockets. |
You need to require "sys/ipc.ph"
before you can use the
symbolic names of the operations.
msgctl ID, CMD, ARGS
| Calls msgctl (2). If CMD is &IPC_STAT then ARGS must be a variable.
|
msgget KEY, FLAGS
| Creates a message queue for KEY. Returns the message queue identifier. |
msgsnd ID, MSG, FLAGS
| Sends MSG to queue ID. |
msgrcv ID, $ var, size , TYPE, FLAGS
| Receives a message from queue ID into var. |
semctl ID, SEMNUM, CMD, arg
| Calls semctl (2). If CMD is &IPC_STAT of &GETALL
then arg must be a variable.
|
semget KEY, NSEMS, size , FLAGS
| Creates a set of semaphores for KEY. Returns the message semaphore identifier. |
semop KEY, … | Performs semaphore operations. |
shmctl ID, CMD, arg
| Calls shmctl (2). If CMD is &IPC_STAT then arg must be a variable.
|
shmget KEY, size , FLAGS
| Creates shared memory. Returns the shared memory segment identifier. |
shmread ID, $ var, pos, size
| Reads at mostsize bytes of the contents of shared
memory segment ID starting at offset pos into var.
|
shmwrite ID, STRING, pos, size
| Writes at mostsize bytes of STRING into the contents of
shared memory segment ID at offset pos.
|
defined expr
| Tests whether the lvalue expr has an value.
|
undef [ lvalue ]
| Undefines the lvalue. Always returns the undefined value. |
do filename
| Executes filename as a Perl script.
See also require
Subroutines, Packages and Modules.
|
dump [ label ]
| core dump, contiune at label .
|
eval { expr ; … } | Executes the code between { and } .
Traps runtime errors as described
with eval ( expr) , in the section String Functions.
|
local variable | |
local ( list )
| Creates a scope for the listed variables local to the enclosing block,
subroutine or eval .
|
my variable
| |
my ( list )
| Creates a scope for the listed variables lexically local to the enclosing block,
subroutine or eval .
|
ref expr£
| Returns a true value if expr is a reference.
Returns the package name if expr has been blessed into a package.
|
reset [ llll ]
| Resets ?? searches so that they work again.llll is a list of single letters. All variables and arrays beginning with one of those letters are reset to their pristine state. Only affects the current package. |
scalar expr | Evaluates expr in scalar context.
|
wantarray | Returns true if the current context expects an array value.
|
passwd returns ($name, $passwd, $uid, $gid, $quota, $comment, $gcos, $dir,
$shell)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
getpwent | Gets next user information. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
getpwnam NAME | by name. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
getpwuid UID | by user ID. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
endpwent | Ends lookup processing. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
setpwent | Resets lookup | ||||||||||||||||||||||||||||||||||||||||||||||||||||
group returns ($name, $passwd,
$gid, $members) .
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
getgrgid GID | by group ID | ||||||||||||||||||||||||||||||||||||||||||||||||||||
getgrnam NAME | by name | ||||||||||||||||||||||||||||||||||||||||||||||||||||
getgrent | Gets next | ||||||||||||||||||||||||||||||||||||||||||||||||||||
setgrent | Resets lookup | ||||||||||||||||||||||||||||||||||||||||||||||||||||
endgrent | Ends lookup | ||||||||||||||||||||||||||||||||||||||||||||||||||||
hosts returns ($ name, $ aliases,
$ addrtype, $ length, @ addrs) .
gethostbyaddr ADDR, ADDRTYPE Gets information by IP address.
| gethostbyname NAME Gets information by hostname.
| gethostent Gets next host information.
| sethostent STAYOPEN Resets lookup processing.
| endhostent Ends lookup processing.
|
| networks returns ($ name, $ aliases,
$ addrtype, $ net) .
getnetbyaddr ADDR, TYPE Gets information by address and type.
| getnetbyname NAME Gets information by network name.
| getnetent Gets next network information.
| setnetent STAYOPEN Resets lookup processing.
| endnetent Ends lookup processing.
|
| services returns ($ name, $ aliases,
$ port, $ proto) .
getservbyname NAME, PROTO Gets information by service name.
| getservbyport PORT, PROTO Gets information by service port.
| getservent Gets next service information.
| setservent STAYOPEN Resets lookup processing.
| endservent Ends lookup processing.
|
| protocols returns ($ name, $ aliases,
$ proto) .
getprotobyname NAME Gets information by protocol name.
| getprotobynumber number Gets information by protocol number.
| getprotoent Gets next protocol information.
| setprotoent STAYOPEN Resets lookup processing.
| endprotoent Ends lookup processing.
| |
use English;
to use variable names (some match those keywords in awk
global and should be localized in subroutines: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
@_ | @ARG parameters passed to subroutine
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
$! | errno when used in a numeric context
error string when used in a string context | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
$@ | error message from the last eval or do expr command.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
$. | current input line number of the last fh that was read. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
$/ | $INPUT_RECORD_SEPARATOR aka $RS newline by default. May be multicharacter.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
$\ | $OUTPUT_RECORD_SEPARATOR for |
@ARGV | 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. |
@INC | directories to search for do filename and require
|
@ISA | base classes of a package. |
@_ | Parameter array for subroutines. Also used by split if not in array context.
|
%ENV | current environment. |
%INC | List of files that have been included with require or do .
|
%OVERLOAD | used to overload operators in a package. |
%SIG | Used to set signal handlers |
Perl uses the following environment variables.
HOME | default for chdir
|
LOGDIR | default for chdir without argument and HOME is not set.
|
PATH | Used for subprocesses, and the Perl script with -S
|
PERL5LIB | colon-separated list of directories to search for library files before looking in the standard library and the current directory. |
PERL5DB | The command to get the debugger code. Default: BEGIN { require 'perl5db.pl' } .
|
PERLLIB | Used instead of PERL5LIB if the latter is not defined.
|
The Perl DebuggerInvoked withperl -d .
DGG's Version
|
-w prints warnings about possible spelling errors and other error-prone constructs in the script.
| | -d runs the script under the debugger. | Use -de 0 to start the debugger without a script
| -D number sets Debugging flags.
| | -F REGEXP specifies a regular expression to split on
| | -p assumes an input loop around script. Lines are printed.
| | -n assumes an input loop around script. Lines are not printed.
| | -a autosplit mode when used with | -n or -p . Splits to @F .
| -c checks syntax but does not execute.
| | -e COMMANDLINE enter a single line of script. | Multiple -e commands may be given to build up a multiline script. if -a is in effect.
| -i EXT files processed by the | < > construct are
to be edited in place.
| -s interprets | -xxx on the command line as a switch and sets
the corresponding variable $xxx in the script.
| -S Search for the script using the | PATH environment variable
| -T Taint checking.
| | -u dumps core after compiling the script. To be used with | >undump .
| -U allows perl to perform Unsafe operations.
| | -v prints the version and patchlevel of your Perl executable.
| | -x [DIR] extracts Perl program from input stream. If DIR is specified,
| CD s to this directory before running the program.
| -0 VAL (zero) Designates an initial value for the Record Separator | $/ . See also -l
| -l [OCTNUM] enables automatic line-end processing, e.g., | -l013 ( ␍ ).
| -P runs the C Preprocessor on the script before compilation by Perl.
| | -I DIR with | -P , tells the C preprocessor where to look for Include files.
The directory is prepended to @INC .
|