Scoping
Variable Scoping
- By default, all variables (and subroutines) in Perl are global
- Perl also supports lexically scoped variable
s
with the keyword: local()
Variables disappear when the program leaves the lexical
scope (ie: a block, subroutine, or file)