From: <ik...@us...> - 2009-09-07 01:54:29
|
Revision: 51 http://webfetch.svn.sourceforge.net/webfetch/?rev=51&view=rev Author: ikluft Date: 2009-09-07 01:54:18 +0000 (Mon, 07 Sep 2009) Log Message: ----------- remove dead code, modernize, docs Modified Paths: -------------- branches/v0.13/lib/WebFetch/Output/TT.pm Modified: branches/v0.13/lib/WebFetch/Output/TT.pm =================================================================== --- branches/v0.13/lib/WebFetch/Output/TT.pm 2009-09-07 01:48:50 UTC (rev 50) +++ branches/v0.13/lib/WebFetch/Output/TT.pm 2009-09-07 01:54:18 UTC (rev 51) @@ -23,7 +23,12 @@ ); +=head1 NAME +WebFetch::Output::TT - save data via the Perl Template Toolkit + +=cut + # set defaults our @Options = ( "template=s", "tt_include:s" ); @@ -34,6 +39,29 @@ # register capabilities with WebFetch __PACKAGE__->module_register( "cmdline", "output:tt" ); +=head1 SYNOPSIS + +In perl scripts: + +C<use WebFetch::Output::TT;> + +From the command line: + +C<perl -w -MWebFetch::Output::TT -e "&fetch_main" -- + [...WebFetch input options...] --dir directory + --dest_format tt --dest dest-path --template tt-file > + +=head1 DESCRIPTION + +This module saves output via the Perl Template Toolkit. + +=item $obj->fmt_handler_tt( $filename ) + +This function formats the data according to the Perl Template Toolkit +template provided in the --template parameter. + +=cut + # Perl Template Toolkit format handler sub fmt_handler_tt { @@ -52,11 +80,9 @@ my $template = Template->new( \%tt_config ); # process template - my $result = $template->process( $self->{template}, $self->{data}, - \$output ); + $template->process( $self->{template}, $self->{data}, \$output ) + or throw_template $template->error(); - $result or throw_template ( $template->error()); - $self->raw_savable( $filename, $output ); 1; } @@ -65,27 +91,6 @@ __END__ # POD docs follow -=head1 NAME - -WebFetch::Output::TT - save data via the Perl Template Toolkit - -=head1 SYNOPSIS - -In perl scripts: - -C<use WebFetch::Output::TT;> - -From the command line: - -C<perl -w -MWebFetch::Output::TT -e "&fetch_main" -- --dir directory - --dest_format tt --dest dest-path [...WebFetch output options...]> - -=head1 DESCRIPTION - -This module saves output via the Perl Template Toolkit. - -TODO: add description - =head1 AUTHOR WebFetch was written by Ian Kluft @@ -95,12 +100,13 @@ =head1 SEE ALSO =for html -<a href="WebFetch.html">WebFetch</a> +<a href="WebFetch.html">WebFetch</a>, +<a href="http://www.template-toolkit.org/>Perl Template Toolkit</a> =for text -WebFetch +WebFetch, Perl Template Toolkit =for man -WebFetch +WebFetch, Perl Template Toolkit =cut This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |