Perl Cheat Sheet Page 24

ADVERTISEMENT

setservent STAYOPEN
Resets look-up processing.
protocols
Returns ( $ name, $ aliases, $ proto).
Ends look-up processing.
endprotoent
Gets information by protocol name.
getprotobyname NAME
Gets information by protocol number.
getprotobynumber NUMBER
getprotoent
Gets next protocol information.
setprotoent STAYOPEN
Resets look-up processing.
27. Special variables
The following variables are global and should be localized in subroutines:
The default input and pattern-searching space.
$_
The current input line number of the last filehandle that was read. Reset only
$.
when the filehandle is closed explicitly.
The input record separator, newline by default. May be multi-character.
$/
$,
The output field separator for the print operator.
The separator which joins elements of arrays interpolated in strings.
$"
The output record separator for the print operator.
$\
The output format for printed numbers. Deprecated.
$#
Set to 1 to do multiline matching within strings. Deprecated, see the
and
$*
m
s
modifiers in section ‘Search and replace functions’.
The status returned by the last ‘ . . . ‘ command, pipe
or
$?
close
system
operator.
$]
The Perl version number, e.g. 5.004 .
The index of the first element in an array, and of the first character in a
$[
substring. Default is 0. Deprecated.
The subscript separator for multi-dimensional array emulation. Default is
$;
"\034" .
If used in a numeric context, yields the current value of errno . If used in a
$!
string context, yields the corresponding error string.
The Perl error message from the last
or
command.
$@
eval
do EXPR
$:
The set of characters after which a string may be broken to fill continuation
fields (starting with ‘ ˆ ’) in a format.
The name of the file containing the Perl script being executed. May be
$0
assigned to.
The process ID of the Perl interpreter running this script. Altered (in the
$$
child process) by
fork
.
The real user ID of this process.
$<
The effective user ID of this process.
$>
The real group ID of this process.
$(
The effective group ID and groups of this process.
$)
$ˆA The accumulator for
formline
and
write
operations.
$ˆD The debug flags as passed to Perl using ‘ -D ’.
$ˆE Extended error message on some platforms.
$ˆF The highest system file descriptor, ordinarily 2.
$ˆH Set of syntax checks enabled by ‘ use strict ’.
24

ADVERTISEMENT

00 votes

Related Articles

Related forms

Related Categories

Parent category: Education