1 | The local construct defines dynamically-scoped variables as in Common Lisp |
2 | 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 |
3 | local extends its scope to any function called from the block in which the local statement is defined |
4 | Perl5 introduced my, which creates true local variables whose scope is confined to the block in which they are defined |
5 | Note: one can use my or local in any block (not just a function) enclosed in { ... } to define temporary variables of limited scope |