in reply to Re^2: my $var masked across package scope?
in thread my $var masked across package scope?
:)
If the idea of "a package scope boundary also being a lexical scope boundary" were actually implemented, would it cause any programs to break?
Yes, changing the rules breaks programs
(And if it did, would they have been correct programs anyway?)
Yes, they would have been correct, if they did what they were supposed to do :)
I'm not saying it's a trivial change, as suddenly package scope is a lexical scope. So, theoretically speaking, are there any downsides to proper nesting of package and lexical scope?
Every programming language with a class keyword uses parens to make scope, not the class keyword
We already have proper nesting of package and lexical scope, so it could be said its a waste of time to redefine proper/nesting/scope rules for everyone
But, a pragma can be created to turn package foo; ... package bar; into package foo;{...} package bar; {...} , using one of those magical B::Hooks:: modules
|
|---|