local

local EXPR

You really probably want to be using my instead, because local isn't what most people think of as "local". See Private Variables via my() in perlsub for details.

A local modifies the listed variables to be local to the enclosing block, file, or eval. If more than one value is listed, the list must be placed in parentheses. See Temporary Values via local() in perlsub for details, including issues with tied arrays and hashes.

The delete local EXPR construct can also be used to localize the deletion of array/hash elements to the current block. See Localized deletion of elements of composite types in perlsub.

© 1993–2016 Larry Wall and others
Licensed under the GNU General Public License version 1 or later, or the Artistic License.
The Perl logo is a trademark of the Perl Foundation.
https://perldoc.perl.org/5.20.2/functions/local.html