http://qs321.pair.com?node_id=1124354

My debug module allows for dumping complex constructs easily, and it honors the debug flag so it can be enabled or disabled dynamically. There is also a predebug- variant which forces it on during development, and then global change/replace can change all predebug to debug and now it is production-ready, honoring the --debug flag.

Here's a sample use case:

#!/usr/bin/perl use strict; use warnings; use debug; my %Gblhas = ( 'ABC' => 1, 'DEF' => [4, { 'JKL' => 7, 'MNO' => 8, 'PQR +' => 9}, 6], 'GHI' => 3 ); &debug::predebugdumplist("\%Gblhas", \%Gblhas); exit; __END__

Yields:

S:\Steve\Dev\datadumper>perl datadumper-oldway.pl %Gblhas (S:/Steve/Perl/debug.pm:887(990)): [ABC] => [1] [DEF] => [ARRAY(0x4ad6b0)] [4] [HASH(0x4ad4b8)] [JKL] => [7] [MNO] => [8] [PQR] => [9] [6] [GHI] => [3] S:\Steve\Dev\datadumper>