howdy, does anyone know how to make a loop that will display all of the data in a file, inside the template?
let's use this as an example template:
<html>
<head>
<title>foo</title>
<head>
<TMPL_VAR NAME="bar">
</html>
and this is what i've got on the script:
#!/usr/bin/perl
use constant HTML::Template;
use constant TMPL_FILE => "template.html";
my $tmpl = new HTML::Template( filename => TMPL_FILE );
$foofile = "foobar.txt";
open( TEMPFILESTREAM, $foofile );
my $foofile = <TEMPFILESTREAM>;
close( TEMPFILESTREAM );
###################################
# this is the grey area....how do #
# i make it loop through all the #
# lines of foobar.txt and display #
# them inside the template? #
###################################
print "Content-type: text/html\n\n",
$tmpl->output;
EOF
thanks in advance,
dom
let's use this as an example template:
<html>
<head>
<title>foo</title>
<head>
<TMPL_VAR NAME="bar">
</html>
and this is what i've got on the script:
#!/usr/bin/perl
use constant HTML::Template;
use constant TMPL_FILE => "template.html";
my $tmpl = new HTML::Template( filename => TMPL_FILE );
$foofile = "foobar.txt";
open( TEMPFILESTREAM, $foofile );
my $foofile = <TEMPFILESTREAM>;
close( TEMPFILESTREAM );
###################################
# this is the grey area....how do #
# i make it loop through all the #
# lines of foobar.txt and display #
# them inside the template? #
###################################
print "Content-type: text/html\n\n",
$tmpl->output;
EOF
thanks in advance,
dom