Also it is a horrible hack, but you can test for scalars that have been declared with vars by evaling a piece of code which switches to that package and tries to access that variable. You can also test if the variable itself has a value. This doesn't, unfortunately, catch variables initialized with our. (Well I don't like our so I don't consider it that unfortunate...) However it catches vars, and it catches the common case of modules that initialize @ISA, etc while declaring them with our. (You also clear out a couple of global variables in main:: which are used by Perl internally.)
If you turn this into a module then I would think carefully about how you want to control what will be checked for errors, allowing someone to readily decide that certain packages and functions are known to be OK, or only certain ones should be checked. After all the maximum utility will happen when you can check your code, see some errors, and then OK them as you figure out that they really are OK...
In reply to Re: Re: Re: "use strict" not too strict
by tilly
in thread "use strict" not too strict
by Mur
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |