|
DebugScriptlette
Purpose and use of the _d.pl scriptlette
IntroductionAs per issue 120 , the _d() debug subroutine found in every tool and common module has been standardized. Because common modules cannot have dependencies with other modules, no Debug common was created. Instead, _d.pl contains the _d() sub that must be manually copied into every tool and module. Copying the Standard _d() SubThe only thing in common/_d.pl is the _d() subroutine. It should not even contain the shebang (#!) line. Therefore, at the end of every module and tool (before 1; for modules or the POD for tools), the standard _d() sub can be read in by using the following vi command: :r ../common/_d.pl Of course, you'll need to adjust the path to _d.pl. Testing _d()Even thought it is not, technically speaking, a common module, _d.pl has a test script: _d.t. This test script reads in _d.pl and evals the _d() sub into its own main namespace so that it can be tested because _d.pl is only a "scriptlette" (that is, a single sub is not really a full script). | |