jonnyfolk has asked for the wisdom of the Perl Monks concerning the following question:
I've tried:
which saves the following to the file:#!/usr/bin/perl -w use strict; use CGI::Carp qw(fatalsToBrowser warningsToBrowser); use CGI ':standard'; use HTML::Template; my $h="path/test.html"; # open the HTML template my $template = HTML::Template->new(filename => 'test.tmpl'); # fill in some parameters in the template $template->param(home => $ENV{HTTP_HOST}); $template->param(path => $ENV{PATH}); # send the obligatory Content-Type print "Content-Type: text/html\n\n"; open(FILE,">$h") || die "Failed opening file: $!"; print FILE "$template->output"; close FILE; print "okay";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: HTML::Template output to file
by sauoq (Abbot) on Dec 01, 2002 at 02:27 UTC | |
by jonnyfolk (Vicar) on Dec 01, 2002 at 08:08 UTC | |
|
Re: HTML::Template output to file
by LTjake (Prior) on Dec 01, 2002 at 01:50 UTC | |
by jonnyfolk (Vicar) on Dec 01, 2002 at 02:23 UTC | |
|
Re: HTML::Template output to file
by pg (Canon) on Dec 01, 2002 at 06:42 UTC | |
by jonnyfolk (Vicar) on Dec 01, 2002 at 08:15 UTC | |
by bart (Canon) on Dec 01, 2002 at 09:52 UTC | |
by Anonymous Monk on Dec 01, 2002 at 10:25 UTC | |
by jonnyfolk (Vicar) on Dec 02, 2002 at 08:41 UTC |