X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fp5-CGI-Ex;a=blobdiff_plain;f=lib%2FCGI%2FEx%2FDump.pm;h=d3f84b43cd76de1e94506adfdddef4366ef517b9;hp=1a9070c38f32a7f2597bfa3610b182a0ec6e6ead;hb=HEAD;hpb=aa030874456c91d688e6c9b25e82d2bf9575ea6f diff --git a/lib/CGI/Ex/Dump.pm b/lib/CGI/Ex/Dump.pm index 1a9070c..d3f84b4 100644 --- a/lib/CGI/Ex/Dump.pm +++ b/lib/CGI/Ex/Dump.pm @@ -7,7 +7,7 @@ CGI::Ex::Dump - A debug utility =cut ###----------------------------------------------------------------### -# Copyright 2007 - Paul Seamons # +# Copyright 2004-2012 - Paul Seamons # # Distributed under the Perl Artistic License without warranty # ###----------------------------------------------------------------### @@ -17,10 +17,10 @@ use vars qw(@ISA @EXPORT @EXPORT_OK $VERSION use strict; use Exporter; -$VERSION = '2.14'; +$VERSION = '2.37'; @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); +@EXPORT_OK = qw(dex dex_warn dex_text dex_html ctrace dex_trace debug caller_trace); ### is on or off sub on { $ON = 1 }; @@ -102,7 +102,7 @@ sub _what_is_this { } else { my $html = "
$called: $file line $line_n\n";
     for (0 .. $#dump) {
-      $dump[$_] =~ s/\\n/\n/g;
+      $dump[$_] =~ s/(?$var[$_]|g;
       $html .= $dump[$_];
@@ -111,8 +111,9 @@ sub _what_is_this {
     return $html if $called eq 'dex_html';
     require CGI::Ex;
     CGI::Ex::print_content_type();
-    print $html;
+    ($CGI::Ex::CURRENT || CGI::Ex->new)->print_body($html);
   }
+  return @_[0..$#_];
 }
 
 ### some aliases
@@ -160,6 +161,8 @@ sub ctrace {
   return \@i;
 }
 
+*caller_trace = \&ctrace;
+
 sub dex_trace {
   _what_is_this(ctrace(1));
 }
@@ -239,8 +242,12 @@ Turns calls to routines on or off.  Default is to be on.
 
 =back
 
+=head1 LICENSE
+
+This module may distributed under the same terms as Perl itself.
+
 =head1 AUTHORS
 
-Paul Seamons 
+Paul Seamons 
 
 =cut