package CGI::Carp::DebugScreen::HTML::Template; use strict; use warnings; use HTML::Template; our $VERSION = '0.15'; my $DebugTemplate =<<'EOT'; Debug Screen

Stacktraces

EOT my $ErrorTemplate =<<'EOT'; An unexpected error has been detected

An unexpected error has been detected

Sorry for inconvenience.

EOT sub as_html { my ($pkg, %options) = @_; $options{error_tmpl} ||= $ErrorTemplate; $options{debug_tmpl} ||= $DebugTemplate; my $tmpl = $options{debug} ? $options{debug_tmpl} : $options{error_tmpl}; my $t = HTML::Template->new( scalarref => \$tmpl, die_on_bad_params => 0, ); $t->param(%options); return $t->output; } 1; __END__ =head1 NAME CGI::Carp::DebugScreen::HTML::Template - CGI::Carp::DebugScreen Renderer with HTML::Template =head1 SYNOPSIS use CGI::Carp::DebugScreen ( engine => 'HTML::Template', # CGI::Carp::DebugScreen::HTML::Template # will be called internally ); =head1 DESCRIPTION One of the ready-made view (renderer) classes for L. =head1 METHOD =head2 as_html will be called internally from L. =head1 SEE ALSO L, L =head1 AUTHOR Kenichi Ishigaki, Eishigaki@cpan.orgE =head1 COPYRIGHT AND LICENSE Copyright (C) 2005-2006 by Kenichi Ishigaki This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut