Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Two tips for developing with HTML::Template

by dws (Chancellor)
on Jan 07, 2003 at 19:49 UTC ( [id://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
Domain Nodelet?
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?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-04-19 02:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found