Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
use strict ; use warnings ; use CGI ; use CGI::Carp qw(fatalsToBrowser); use Data::Dumper ; use Data::Dump 'pp'; use InfoD; use HTML::Template; my $q = CGI->new; start(); sub start { my $return_val_from_tables = tables(); # Main Template my $main_tmpl = HTML::Template->new(filename => 'templates/main.tmpl' +, die_on_bad_params => 0,); # load values into the main template my $name = "Proto"; $main_tmpl->param( NAME => $name, STUFF => 'TEST', LOAD => $return_val_from_tables->output(), ); print $q->header, $main_tmpl->output; }
sub tables { my @rows = ( ... ) ; # Load new template to add to main template later my $table_tmpl = HTML::Template->new(filename => 'templates/table.tmp +l', die_on_bad_params => 0,); #Load these values into the template $table_tmpl->param( DATA => \@rows, ); # Load this template into main template my $table_load = $table_tmpl->output(); return $table_load; } 1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Return value to use in HTML::Template
by poj (Abbot) on Jan 08, 2016 at 22:16 UTC | |
|
Re: Return value to use in HTML::Template
by Anonymous Monk on Jan 08, 2016 at 21:52 UTC |