Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

marinersk's scratchpad

by marinersk (Priest)
on Apr 23, 2015 at 03:05 UTC ( #1124354=scratchpad: print w/replies, xml ) Need Help??

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>

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2021-04-10 11:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?