=cut
###----------------------------------------------------------------###
-# Copyright 2007 - Paul Seamons #
+# Copyright 2004-2012 - Paul Seamons #
# Distributed under the Perl Artistic License without warranty #
###----------------------------------------------------------------###
use strict;
use Exporter;
-$VERSION = '2.20';
+$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 };
} else {
my $html = "<pre class=debug><span class=debughead><b>$called: $file line $line_n</b></span>\n";
for (0 .. $#dump) {
- $dump[$_] =~ s/\\n/\n/g;
+ $dump[$_] =~ s/(?<!\\)\\n/\n/g;
$dump[$_] = _html_quote($dump[$_]);
$dump[$_] =~ s|\$VAR1|<span class=debugvar><b>$var[$_]</b></span>|g;
$html .= $dump[$_];
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
return \@i;
}
+*caller_trace = \&ctrace;
+
sub dex_trace {
_what_is_this(ctrace(1));
}