Skip to Main Content
Perl Pocket Reference, 5th Edition
book

Perl Pocket Reference, 5th Edition

by Johan Vromans
July 2011
Intermediate to advanced content levelIntermediate to advanced
104 pages
2h 14m
English
O'Reilly Media, Inc.
Content preview from Perl Pocket Reference, 5th Edition

Miscellaneous

defined expr

Tests whether the scalar expression has an actual value.

do { expr ; . . . }

Executes the block and returns the value of the last expression. See also the section Statements.

do filename

Executes filename as a Perl script. See also require in page 16.

eval { expr ; . . . }

Executes the code between { and }. Traps runtime errors as described with eval(expr) in page 30.

local [ our ] variable

Gives a temporary value to the named package variable, which lasts until the enclosing block, file, or eval exits. variable may be a scalar, an array, a hash, or an element (or slice) of an array or hash.

my varlist

varlist is a variable, or parenthesized list of variables. Creates a scope for the variables lexically local to the enclosing block, file, or eval.

my [ class ] varlist [ attributes ]

Experimental. Built-in attribute is :shared. Module Attribute::Handlers can be used to define additional attributes.

our varlist

Declares the variables to be a valid global within the enclosing block, file, or eval.

our [ class ] varlist [ attributes ]

Experimental. Built-in attributes are :shared and :unique. Module Attribute::Handlers can be used to define additional attributes.

ref expr

Returns the referent type if expr is a reference. Returns the package name if expr has been blessed into a package.

reset [ expr ]

expr is a string of single letters. All variables in the current package beginning with one of those letters are reset to their pristine state. If expr is omitted, resets ?? searches ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Perl Testing: A Developer's Notebook

Perl Testing: A Developer's Notebook

Ian Langworth, Chromatic
Perl Hacks

Perl Hacks

Chromatic, Damian Conway, Curtis Ovid Poe, Curtis (Ovid) Poe

Publisher Resources

ISBN: 9781449311186Errata Page