LPM: Text::Template and server-side includes in HTML files

David Hempy hempy at ket.org
Thu Aug 31 14:47:27 CDT 2000

At 03:13 PM 8/31/2000 -0400, you wrote:

>the reason you cant do ssi in cgi is that ssi is parsed by the web server
>before the headers and what not are even sent out. in cgi stuff, the
>server cant parse your content because it doesnt have the data before
>sending out headers and what not.
>Matt Cashner

I think I see your point, but it would still be nice (and do-able) for the 
server to allow parsing of CGI output.  No reason it couldn't parse the 
body after the headers are already out the door.

>getting rid of the while loop is all well and good but you have to append
>to $OUT if you want reliable output in Text::Template.

Not necessarily...if $OUT doesn't get a value in the eval block, it will 
use the last value evaluated within the block.  You can say:

Here are the colors: <<
         @colors = ('blue', 'green', 'red');
         join (', ' , @colors);
 >> <br>

The last value (what join returns) will be used in the output.  About the 
only time I use $OUT is when there is a loop or different values chosen by 
conditionals.  If it is a straight substitution or transformation, I don't 

I think of this as analogous to ending a module with "1;" so the final 
value is true.


David Hempy
Internet Database Administrator
Kentucky Educational Television
<hempy at ket.org> -- (859)258-7164 -- (800)333-9764

More information about the Lexington-pm mailing list