Are there any modules that I am missing to help me write better code?

I use the following command to test my perl code:

perl -MB :: Lint :: StrictOO -MO = Lint, all, oo -M-circle :: require -M-indirect -Mwarnings :: method -Mwarnings :: unused -c $ file

On a system with perl version less than 5.10, I also use uninit.

I also use Perl :: Critic and Perl :: Tidy and have customized the corresponding rc files to my liking.

These modules did a great job helping me overcome some bad habits that I learned when I first studied perl.

Are there any other modules or pragmas that hit me straight and narrow when I messed up?

The use of tests and the Test :: * family of modules and some good books have been noted. This new information made me rethink some assumptions about the relationship between testing and code building. All of them are being evaluated and are already being researched and used.

It seems to me that these are two separate parts of the whole. 'perl -c', Perl :: Critic and Perl :: Remove all help while writing code and before executing code. Devel :: Cover, Devel :: NYTProf and tests occur during and after code execution.

An iterative process dictates good development, so the tests will be executed, and the code will be developed again and again, but we still have this separation.

It seems to me that the main focus in the answers was "during and after execution" of the code. Again, this is very much appreciated. Can I assume that I have the โ€œwriting and pre-executionโ€ part? At least, as well as pragmas, modules and utilities.

+8
perl code analysis
source share
2 answers

I am a little worried that you are using Perl 5.9. For two reasons.

Firstly, it is a little old. 5.9.0 was released in 2003 and 5.9.5 (the latest version in the 5.9.x series) was released in 2007. Since then there have been several high-quality versions of Perl.

Secondly (and most importantly), 5.9 is an unstable version of Perl. 5.9 is basically a series of experiments that ultimately led to Perl 5.10.0. The only reason to use it is to verify that 5.10 will be a stable version of Perl. No one should use it now.

+4
source share

It seems you are not checking your code, just checking its compilation. I suggest you take a look at Test :: More (which makes recording real tests pleasant and easy), Test :: Class (which simplifies working with very large test suites) and Devel :: Cover (to see which bits of your code are covered by your tests and which are not).

+2
source share

All Articles