Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Two tips for developing with HTML::Template

by dws (Chancellor)
on Jan 07, 2003 at 19:49 UTC ( #225054=perlmeditation: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
      my $template;
      eval {
          $template = new HTML::Template(filename => 'foo.tmpl');
    ...
      eval {
          print $template->output();
      };
    
  2. or download this
      <TMPL_IF debug>
      <ul>
      <TMPL_LOOP debuglog>
    ...
      <TMPL_ELSE>
      ... the non-debug page ...
      </TMPL_IF>
    
  3. or download this
      my @debuglog = ();
    
      if ( ... ) {
    ...
      ...
      $template->parameter(debug => 0 != @debuglog);
      $template->parameter(debuglog => \@debuglog);
    
  4. or download this
      sub debuglog {
          push @debuglog, {item => $_} for ( @_ );
      }
    
  5. or download this
      debuglog("Some message") if ( ... );

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://225054]
Approved by Mr. Muskrat
Front-paged by wil
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (9)
As of 2015-07-03 13:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (53 votes), past polls