The lexical form is certainly more limited.
I don't really agree with that sentence. Being able to limit the scope is usually extremely useful. It not only reduces the risk of errors associated with global variables (and other global identifiers), but it also makes it possible to build very powerful constructs.
Perl 5.0 introduced lexical variables, Perl 5.6 introduced lexical file and directory handles, Perl 5.18 introduced lexical subroutines, the tendency over the years has been to go more and more for lexical "things". Because they add a lot of expressive power to the language.
| [reply] |