http://www.perlmonks.org?node_id=982274


in reply to Re^3: Universal test flag
in thread Universal test flag

Exactly! That is precisely the idea: to give a more intelligible diagnostic message instead of having to go through millions of debug messages.

Whilst the general consensus that the smallest testable unit is a sub, in many real world applications this is simply not the case. A lot of business code has a lot of state data shared in long subroutines. They are always room for refactoring but in the mean time, you need to provide mechanisms to test this code the best you can.