in reply to
TDD of non-module code
AFAIK, Perl doesn’t have an #ifdef capability, which is unfortunate. I think that you probably are going to have to put the code into modules, unless you merely intend to be doing “black box” regression-testing, because you do need to be able to isolate the functionality that is under test. But there are real advantages to modularity that have more value than simply to facilitate unit-testing: modular code is inherently less coupled because there are only a few well-defined “ways in” and “ways out” for each “thing.” It is the way that I would design such code anyway.