Re: RFC 106 (v1) Yet another lexical variable proposal: lexical variables made default
[email protected] (Nathan Torkington) Tue, 15 Aug 2000 19:29:17 -0600 (MDT)
| Newsgroups | perl.perl6.language.strict |
|---|---|
| Message-ID | <[email protected]> |
Perl6 RFC Librarian writes: > The chief instance where Perl5 requires dynamic variables is in the > case of package globals. I think this is a bad idea (so I'm glad you made it optional). Global variables are important. They provide a mechanism for a separate module to add new behaviour to Perl: global variables function as configuration information that can be accessed by other packages (e.g., Exporter), and is used in the more general case of subclasses needing access to superclasses' innards. They're an escape hatch for programmers: language didn't build something in? Add it on! Grafting your own stuff into another module's package is how Class::Struct works, and I'm still unconvinced there should be a difference between subs and data in this respect. Any suggestion to make lexical variables accessible from outside their scope to solve this is also extremely dangerous (IMHO). > Very little will have to be done to translate Perl5 to Perl6 under > this proposal. Except if global variables are eliminated. Nat