Perl functions references- local Function - Perl Scripting

What is the Perl local function?

Description

This function sets the variables in LIST in a local format to the current execution block. If more than one value is specified, you must use parentheses to define the list.
Make a note that local creates a local copy of a variable, which then goes out of scope when the block which is enclosed terminates. The localized value is then used whenever it is accessed, including any subroutines and formats used during that block.

Syntax

Following is the simple syntax for this function −

Return Value

This function does not return any value.

Example

Following is the example code showing its basic usage −

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Perl Scripting Topics