Help for this page
# secret.pl use HTML::Template; ... my $template = HTML::Template->new(filename => 'secret.tmpl'); $template->param(SECRET_MESSAGE => $bar); print $template->output;
<!-- secret.tmpl --> <h1>Hello <TMPL_VAR NAME=SECRET_MESSAGE></h1>
<!-- secret2.tmpl --> <TMPL_IF NAME="ILLUMINATI"> ... SECRET_MESSAGE => 'There is no Perl Illuminati', ); print $template->output;
<!-- secret2.tmpl --> <TMPL_IF NAME="SECRET"> ... my $template = HTML::Template->new(filename => 'secret2.tmpl'); $template->param(SECRET => $message); print $template->output;
<!-- students.tmpl --> <TMPL_LOOP NAME=STUDENT> ... ] ); print $template->output;
<!-- songs.tmpl --> <html> ... $DBH->disconnect();
push @{$rows}, $_ while $_ = $sth->fetchrow_hashref();
{ 'artist' => 'Van Halen', ... 'album' => 'Van Halen II', 'year' => '1979', };
# we don't need no stinkin' column names my $rows = $DBH->selectall_arrayref('select * from songs'); ... die_on_bad_params => 0, ); $template->param(ROWS => $rows);
my $CGI = CGI->new(); my $template = HTML::Template->new( filename => 'foo.tmpl', associate => $CGI, );
<!-- pill.tmpl --> <table> ... loop_context_vars => 1, ); # etc.
my $template = HTML::Template->new(scalarref => \$scalar);
#!/usr/bin/perl -Tw use DBI; ... </body> </html>
Ceramics Glass Wood Metal Plastic Paper Banana leaves Something else
Results (445 votes), past polls