[sf-perl] use {strict,warnings}

Quinn Weaver quinn at fairpath.com
Sun Mar 2 15:28:10 PST 2008

On Sun, Mar 02, 2008 at 02:24:36PM -0800, Rich Morin wrote:

> So, I'd like to hear folks' opinions on what kinds of tests they
> find most (and least :-) useful, what tests they'd like to have,
> how best to make them minimally annoying, etc.

Most useful (paraphrased):

- use of undefined variable (catches typos, among other things)
- variable already defined (for instance, two my $var = statements in one scope)
- couldn't find $package; did you remember to load $module?
- no such method $foo (happens at runtime, unfortunately, due to late binding)
- close called on an unopened filehandle

Least useful:

- Can't think of any. :)

Best way to make them useful:

- Wherever possible, make the analysis static.
- If you can't do perfectly reliable static analysis, heuristics are still good.
- Make some kind of prepackaged test target that runs your all your tests
  (or a chosen subset) and either flunks your program or gives it a clean
  bill of health.

Quinn Weaver, independent contractor  |  President, San Francisco Perl Mongers
http://fairpath.com/quinn/resume/     |  http://sf.pm.org/

More information about the SanFrancisco-pm mailing list