Posted By

alfirth on 03/11/11


Tagged


Versions (?)

debug dumpers


 / Published in: Perl
 

  1. #standard debug Data Dumper
  2. sub DD { #DD(anything)
  3. return unless ($DEBUG);
  4. my (@ref) = @_;
  5. $Data::Dumper::Indent = 1;
  6. print Dumper(@ref);
  7. }
  8.  
  9. #standard debug Dump to File
  10. sub DTF { #DTF($filename, anything)
  11. return unless ($DEBUG);
  12. my ($file, @args) = @_;
  13. open (FILE, '+>>', "$file") or warn ("Unable to open $file for debug writing\n");
  14. $Data::Dumper::Indent = 1;
  15. print FILE Dumper(@args);
  16. close (FILE);
  17. }

Report this snippet  

You need to login to post a comment.