Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
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 chilling in the Monastery: (2)
As of 2014-07-26 14:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (177 votes), past polls