Section 1

Preview this deck

$\ and $ORS

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

2 years ago

Date created

Mar 1, 2020

Cards (81)

Section 1

(50 cards)

$\ and $ORS

Front

The output record separator for the print operator.

Back

$, and $OFS

Front

The output field separator for the print operator.

Back

$0 and $PROGRAM_NAME

Front

Contains the name of the file containing the Perl script being executed.

Back

$^T and $BASETIME

Front

The time at which the script began running, in seconds since the epoch.

Back

$$ and $PROCESS_ID or $PID

Front

The pid of the Perl process running this script.

Back

-e

Front

interactive mode in Perl

Back

slice

Front

is an array subset

Back

Lexical variables

Front

Private variables

Back

$^M

Front

The contents of $M can be used as an emergency memory pool in case Perl dies with an out-of-memory error. Use of $M requires a special compilation of Perl. See the INSTALL document for more information.

Back

$^D and $DEBUGGING

Front

The current value of the debugging flags.

Back

$< and $REAL_USER_ID or $UID

Front

The real user ID (uid) of this process.

Back

$? and $CHILD_ERROR

Front

The status returned by the last pipe close, backtick (``) command, or system operator.

Back

@INC

Front

The array containing the list of places to look for Perl scripts to be evaluated by the do, require, or use constructs.

Back

$> and $EFFECTIVE_USER_ID or $EUID

Front

The effective user ID of this process.

Back

$. and $NR

Front

The current input line number of the last filehandle that was read. An explicit close on the filehandle resets the line number.

Back

unshift

Front

places elements at beginning of array,

Back

$^H

Front

Contains internal compiler hints enabled by certain pragmatic modules.

Back

$^I and $INPLACE_EDIT

Front

The current value of the inplace-edit extension. Use undef to disable inplace editing.

Back

$/ and $RS

Front

The input record separator; newline by default. If set to the null string, it treats blank lines as delimiters.

Back

'

Front

Literal thing

Back

Chomp

Front

This safer version of chop removes any trailing string that corresponds to the current value of $/ (also known as $INPUT_RECORD_SEPARATOR in the English module). It returns the total number of characters removed from all its arguments. By default $/ is set to new line character.

Back

Scalar

Front

Scalars are simple variables. They are preceded by a dollar sign ($). A scalar is either a number, a string, or a reference. A reference is actually an address of a variable, which we will see in the upcoming chapters.

Back

$^P and $PERLDB

Front

The internal flag that the debugger clears so that it doesn't debug itself.

Back

$: and $FORMAT_LINE_BREAK_CHARACTERS

Front

The current set of characters after which a string may be broken to fill continuation fields (starting with ^) in a format. Default is "
"".

Back

shift

Front

This function returns the first value in an array, deleting it and shifting the elements of the array list to the left by one

Back

$^O and $OSNAME

Front

Contains the name of the operating system that the current Perl binary was compiled for.

Back

$@ and $EVAL_ERROR

Front

The Perl syntax error message from the last eval command.

Back

@ARGV

Front

The array containing the command-line arguments intended for the script.

Back

Set Environment variable

Front

$ENV{something} = 'file path';

Back

Array

Front

Arrays are ordered lists of scalars that you access with a numeric index which starts with 0. They are preceded by an "at" sign (@).

Back

$# and $OFMT

Front

Contains the output format for printed numbers (deprecated).

Back

Nested Datatypes

Front

Back

$^A and $ACCUMULATOR

Front

The current value of the write accumulator for format lines.

Back

$^W and $WARNING

Front

The current value of the warning switch, either true or false.

Back

"

Front

Perl will interpolate things

Back

$" and $LIST_SEPARATOR

Front

Like "$," except that it applies to list values interpolated into a double-quoted string (or similar interpreted string). Default is a space.

Back

$( and $REAL_GROUP_ID or $GID

Front

The real group ID (gid) of this process.

Back

$[

Front

The index of the first element in an array and of the first character in a substring. Default is 0.

Back

$^F and $SYSTEM_FD_MAX

Front

The maximum system file descriptor, ordinarily 2.

Back

$^X and $EXECUTABLE_NAME

Front

The name that the Perl binary itself was executed as.

Back

$) and $EFFECTIVE_GROUP_ID or $EGID

Front

The effective gid of this process.

Back

$^L and $FORMAT_FORMFEED

Front

What a format outputs to perform a formfeed. Default is "\f".

Back

$! and $OS_ERROR or ERRNO

Front

If used in a numeric context, yields the current value of the errno variable, identifying the last system call error. If used in a string context, yields the corresponding system error string.

Back

$^E and $EXTENDED_OS_ERROR

Front

Extended error message on some platforms.

Back

$_ and $ARG

Front

The default input and pattern-searching space.

Back

Hash

Front

Hashes are unordered sets of key/value pairs that you access using the keys as subscripts. They are preceded by a percent sign (%).

Back

$; and $SUBSCRIPT_SEPARATOR

Front

The subscript separator for multidimensional array emulation. Default is "\034".

Back

last

Front

equivalent to break in other languages.

Back

Three data types

Front

Scalar, Array, Hash

Back

$] and $PERL_VERSION

Front

Returns the version plus patchlevel divided by 1000.

Back

Section 2

(31 cards)

__LINE__

Front

Represents the current line number. Not interpolated into strings.

Back

DATA

Front

The special filehandle that refers to anything following the __END__ token in the file containing the script. Or, the special filehandle for anything following the __DATA__ token in a required file, as long as you're reading data in the same package __DATA__ was found in.

Back

%ENV

Front

The hash containing your current environment.

Back

$~ and $FORMATT_NAME

Front

The name of the current report format for the currently selected output channel. Default is the name of the filehandle.

Back

$' and $POSTMATCH

Front

The string following whatever was matched by the last successful pattern match.

Back

__PACKAGE__

Front

Represents the current package name at compile time, or undefined if there is no current package. Not interpolated into strings.

Back

STDOUT

Front

The special filehandle for standard output in any package.

Back

command-line argument

Front

a single character preceded by a hyphen

Back

$% and $FORMAT_PAGE_NUMBER

Front

The current page number of the currently selected output channel.

Back

STDERR

Front

The special filehandle for standard error in any package.

Back

$ARGV

Front

Contains the name of the current file when reading from <ARGV>.

Back

$#ARGV

Front

A subscript of the last element of the @ARGV array

Back

%INC

Front

The hash containing entries for the filename of each file that has been included via do or require.

Back

STDIN

Front

The special filehandle for standard input in any package.

Back

abstraction

Front

a technique for managing complexity of computer systems. It works by establishing a level of complexity on which a person interacts with the system, suppressing the more complex details below the current level.

Back

$- and $FORMAT_LINES_LEFT

Front

The number of lines left on the page of the currently selected output channel.

Back

$^ and $FORMAT_TOP_NAME

Front

The name of the current top-of-page format for the currently selected output channel. Default is the name of the filehandle with _TOP appended.

Back

ARGV

Front

The special filehandle that iterates over command line filenames in @ARGV. Usually written as the null filehandle in <>.

Back

@F

Front

The array into which the input lines are split when the -a command-line switch is given.

Back

__FILE__

Front

Represents the filename at the point in your program where it's used. Not interpolated into strings

Back

$& and $MATCH

Front

The string matched by the last successful pattern match.

Back

_(underscore)

Front

The special filehandle used to cache the information from the last stat, lstat, or file test operator.

Back

$+ and $LAST_PAREN_MATCH

Front

The last bracket matched by the last search pattern. This is useful if you don't know which of a set of alternative patterns was matched. For example: /Version: (.)|Revision: (.)/ && ($rev = $+);

Back

$` and $PREMATCH

Front

The string preceding whatever was matched by the last successful pattern match.

Back

$=, $FORMAT_LINES_PER_PAGE

Front

The current page length (printable lines) of the currently selected output channel. Default is 60.

Back

$| and $OUTPUT_AUTOFLUSH

Front

If set to nonzero, forces an fflush(3) after every write or print on the currently selected output channel.

Back

%SIG

Front

The hash used to set signal handlers for various signals.

Back

__END__

Front

Indicates the logical end of your program. Any following text is ignored, but may be read via the DATA filehandle.

Back

$digit

Front

Contains the text matched by the corresponding set of parentheses in the last pattern matched. For example, $1 matches whatever was contained in the first set of parentheses in the previous regular expression.

Back

->

Front

reference operatorto access elements

Back

handle

Front

is an abstract reference to a resource. Handles are used when application software references blocks of memory or objects managed by another system, such as a database or an operating system.

Back