10. Testing

Perl has an amazing test culture, and a great set of tools for testing and managing your code. It might even have some of the most widely tested code on the planet, thanks to CPAN Testers (Item 97).

Perl has had a testing infrastructure in place since the first Perl modules came out. The testing craze really took off when Michael Schwern starting pushing testing with the Test::More module, which made testing almost trivial. You simply loaded the module and called some convenience functions:

image

The Test::More module emits TAP (Test Anywhere Protocol), a simple results format that was started in Perl and has spread to many other languages. ...

Get Effective Perl Programming: Ways to Write Better, More Idiomatic Perl, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.