Devel::StealthDebugDevel::StealthDebug is a simple non-intrusive debug module. | |
Download |
Devel::StealthDebug Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Arnaud ASSAD
- Publisher web site:
- http://search.cpan.org/~aassad/Devel-StealthDebug-1.008/StealthDebug.pm
Devel::StealthDebug Tags
Devel::StealthDebug Description
Devel::StealthDebug is a simple non-intrusive debug module. Devel::StealthDebug is a simple non-intrusive debug module.SYNOPSIS# in user's code:use Devel::StealthDebug;... #!assert(< cond >)! will die at this line if < cond > is not verified...... #!watch(< var_name >)! will carp each access to < var_name > (Idea from Srinivasan's monitor module)... #!emit(< double_quoted_string_to_be_printed >)! will 'emit' the string Depending on emit_type it will print, carp, croak or add to a file carp is the default value for emit_type... #!dump(< ref to a variable to be dumped >,< another ref >,...)! will emit the variable's structure... #!when(< var_name >,< op >,< value >)! will emit when < var_name > will pass the condition described by < op >< value >. Currently, only works for 'watched' scalar... ... #!emit_type(carp|croak|print)! Define the emit's behaviour Can also be set on the use line : use Devel::StealthDebug emit_type => 'croak'; Note that if you set it this way you gain an additional feature, you can now emit to a file : use Devel::StealthDebug emit_type => '/path/to/file'; 'carp' being the default value You can also pass other optionq on the use line : use Devel::StealthDebug ENABLE=>'/path/to/file'; or use Devel::StealthDebug ENABLE=>$ENV{WHATEVER}; or use Devel::StealthDebug DUMPER=>1; The third form will make the 'dump' function use Data::Dumper.The second form enable debugging only if the var passed as value is 'true' (i.e. different from undef,'',zero, or empty list) The first form will enable the debug instructions if '/path/to/file' don't exist or exist AND contain a line (regex) which match the current file name.This behaviour may sound odd, but as there's no way to know it you pass a value or a filename, a first test is made to check if the file exists, if it isn't the case then a value is assumed (so '/path/to/missing/file' is treated as a value which is 'true' and so debugging is enabled). If the file exists, debugging is disabled unless this file contains a line whith a regex which matchs the current file name. Requirements: · Perl
Devel::StealthDebug Related Software