The local construct defines dynamically-scoped variables as in Common Lisp |
A call to local does not create a new variable! In effect, it makes a copy of its argument, whose original value is restored when the block is finished executing |
local extends its scope to any function called from the block in which the local statement is defined |
Perl5 introduced my, which creates true local variables whose scope is confined to the block in which they are defined |
Note: one can use my or local in any block (not just a function) enclosed in { ... } to define temporary variables of limited scope |