.------[ Jeff Norman wrote (2000/06/07 at 14:27:29) ]------
 | 
 |  Frequently, it's hard to build up an entire output segment without
 |  code in-between the different additions to the output.  I guess you could
 |  call this the "append, append, append... output" technique.
 |  
 |  I think it would be an interesting addition to the benchmark:
 |  
 |     sub gather_print{
 |       my $buffer = '';
 |       $buffer .= "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML//EN\">";
 |       $buffer .= "<HTML>";     
 |       $buffer .= "  <HEAD>";   
 |       $buffer .= "    <TITLE>";
 |       $buffer .= "      Test page";
 |       $buffer .= "    </TITLE>";
 |       $buffer .= "  </HEAD>";
 |       $buffer .= "  <BODY BGCOLOR=\"black\" TEXT=\"white\">";
 |       $buffer .= "    <H1> ";
 |       $buffer .= "      Test page ";
 |       $buffer .= "    </H1>";
 |       $buffer .= "    <A HREF=\"foo.html\">foo</A>";
 |       $buffer .= "    <HR>"; 
 |       $buffer .= "  </BODY>";
 |       $buffer .= "</HTML>";
 |       print $fh $buffer;
 |     }
 |  
 `-------------------------------------------------

    What the other programmer here and I do is setup an array and push()
    our lines of output onto it throughout all our code, and print it at
    the very end.  I'd be interested in seeing benchmarks of this vs.
    the other methods.  I'll try to find the time to run them. 

 -------------------------------
  Frank Wiles <[EMAIL PROTECTED]>
  http://frank.wiles.org
 -------------------------------

Reply via email to