Chapter 34. 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 Chapter 11.
- do filename
Executes filename as a Perl script. See also require.
- eval
{expr;...} Executes the code between { and }. Traps runtime errors and returns as described with eval(expr).
- 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 variable
Creates a scope for the variable lexically local to the enclosing block, file, or eval.
- my [ class ] variable [ attributes ]
Experimental. Built-in attribute is
:shared.ModuleAttribute::Handlerscan be used to define additional attributes.- our variable
Declares the variable to be a valid global within the enclosing block, file, or eval.
- our [ class ] variable [ attributes ]
Experimental. Built-in attributes are
:sharedand:unique.ModuleAttribute::Handlerscan be used to define additional attributes.- ref expr†
Returns true 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 so that they work again.- undef [ lvalue ]
Undefines the lvalue. Always ...
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.
Read now
Unlock full access