Miscellaneous Functions


FunctionPurpose

caller(expr)

Returns information about the subroutine call stack in the form of ($package, $filename, $line). This information is primarily used by the debugger to print out stack traces.

defined(expr)

Returns a Boolean value whether or not expr has a real value.

local(list)

Creates local versions of a list of variable names.

package {namespace}

Switches the variable namespace to namespace. If namespace is not specified, it switches back to the main package namespace.

require f1

Includes code that is located in file f1.

reset {expr}

Clears variables or resets searches. Used at the top of a loop or in a continue block at the end of a loop.

study{scalar}

Studies scalar ($_ if scalar is unspecified) in anticipation of performing pattern matches on the string before it is next modified.

sub name(arglist)

Defines a subroutine named name with the arguments specified in arglist.

undef{expr}

Undefines the value of expr, which must be lvalue. If expr is not specified, returns an undefined value that could be returned from a subroutine.

wantarray

Returns "true" if the context of the currently executing subroutine is looking for an array value (rather than a scalar value).