Perl: Private Variables
Private Variables
Until now, all variables have been global (accessible throughout the program)
Private variables can be declared which are only accessible within its block
To create a private variable, precede the variable name with my for its initialization, or the first time it is used.
Variables can be private to any block, usually subroutines, but also loops, if blocks, etc.