Edward Peschko wrote:
> > Tell me one. I couldn't find it.
>
> The main problem I see is cross checking. I *like* having to declare
things as
> 'my' - it catches my errors for me:
>
> my $variable;
> $varaible = 1; # mis-spelled - caught by 'use strict'.
>

Still would be able to do it with `use strict'. My proposal isn't going to
replace it! As it didn't replace the default global variables! As I said, I
don't want you to use it or even like it, I'm only wanting YAWTDI.



> If you had this 'use scope' pragma, this auto-error checking would be
> compromised severely.
>

Actually, I think sometimes it can be done with -w (``Variable xyz used only
once, probably spelling error'').



> However, that still doesn't get rid of the gotchas - personally I think
that:
> my $a, $b, $c;
> should be an error, a warning, or DWIM. Especially:
> my $a, $b;
>

OK. Fine to me. Under `use strict' it actually would be already an error.



> I'm also fond of making 'use strict' and '-w' ON by default, and turned
off by
> pragma. But that's just me.
>

I'm fond of having an alternative to it, ie. `use scope'. I don't want it by
default, as I don't want it to replace `strict' either. It would only be
there for anyone decide if he would or wouldn't use it.



As to turn on by default, I actually don't think making one of this things
default would be good, because it would make one-liners and small quick and
dirty scripts some harder to write. For longer scripts and modules (that
already are many lines long), writing one or two more lines isn't expensive
at all...

- Branden

Reply via email to