X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fp5-CGI-Ex;a=blobdiff_plain;f=lib%2FCGI%2FEx%2FDump.pm;h=af5a00b771076ff78c5bd9af0e70ba70cf54f0c9;hp=c4d49f977f3d7d71ad25167eb0f40704129c636f;hb=48c4840be1f154e262de2c161cb86dc5000dfe47;hpb=d710d6cd21be21c0ab2df3566c2bd61d9015cac6 diff --git a/lib/CGI/Ex/Dump.pm b/lib/CGI/Ex/Dump.pm index c4d49f9..af5a00b 100644 --- a/lib/CGI/Ex/Dump.pm +++ b/lib/CGI/Ex/Dump.pm @@ -13,11 +13,11 @@ CGI::Ex::Dump - A debug utility use vars qw(@ISA @EXPORT @EXPORT_OK $VERSION $CALL_LEVEL - $ON $SUB $QR1 $QR2 $full_filename); + $ON $SUB $QR1 $QR2 $full_filename $DEPARSE); use strict; use Exporter; -$VERSION = '2.04'; +$VERSION = '2.05'; @ISA = qw(Exporter); @EXPORT = qw(dex dex_warn dex_text dex_html ctrace dex_trace); @EXPORT_OK = qw(dex dex_warn dex_text dex_html ctrace dex_trace debug); @@ -25,22 +25,22 @@ $VERSION = '2.04'; ### is on or off sub on { $ON = 1 }; sub off { $ON = 0; } -&on(); -sub set_deparse { - $Data::Dumper::Deparse = eval {require B::Deparse}; -} +sub set_deparse { $DEPARSE = 1 } ###----------------------------------------------------------------### BEGIN { - ### setup the Data::Dumper usage - $Data::Dumper::Sortkeys = 1 if ! defined $Data::Dumper::Sortkeys; # not avail pre 5.8 - $Data::Dumper::Useqq = 1 if ! defined $Data::Dumper::Useqq; - $Data::Dumper::Quotekeys = 0 if ! defined $Data::Dumper::Quotekeys; - $Data::Dumper::Pad = ' ' if ! defined $Data::Dumper::Pad; - #$Data::Dumper::Deparse = 1 if ! defined $Data::Dumper::Deparse; # very useful + on(); + $SUB = sub { + ### setup the Data::Dumper usage + local $Data::Dumper::Deparse = $DEPARSE && eval {require B::Deparse}; + local $Data::Dumper::Pad = ' '; + local $Data::Dumper::Sortkeys = 1; + local $Data::Dumper::Useqq = 1; + local $Data::Dumper::Quotekeys = 0; + require Data::Dumper; return Data::Dumper->Dumpperl(\@_); };