CGI で HTML::Template 関数を実行できません。
ここで見つけた簡単なチュートリアルに従っています: http://metacpan.org/pod/HTML::Template
サーバーのホームパスにtest.tmplとして新しいファイルを作成しました。
frt.cgi という名前の新しいファイルを作成しました ... (それが問題なのですか? ファイル拡張子が異なるはずですか??)
#!/usr/local/bin/perl -w
use HTML::Template;
# open the html template
my $template = HTML::Template->new(filename => '/test.html');
# fill in some parameters
$template->param(HOME => $ENV{HOME});
$template->param(PATH => $ENV{PATH});
# send the obligatory Content-Type and print the template output
print "Content-Type: text/html\n\n", $template->output;
ホストが提供する perl のプログラム パスを反映するように 1 行目を変更しました。-w が何をするのかわかりません。これを使用して、または使用せずに試したことを知っているだけです。また、コードを次のように少し変更してみました。
use warnings;
use strict;
use CGI qw(:standard);
use HTML::Template;
検索しました...
https://stackoverflow.com/search?q=HTML%3A%3ATEMPLATE+&submit=search
https://stackoverflow.com/search?q=HTML%3A%3ATEMPLATE
https://stackoverflow .com/search?q=HTML%3A%3ATEMPLATE+PERL&submit=検索
それでも答えは見えません。特別なタイプが必要かもしれないと思ったので、Googleで.TMPL Encodingを検索しました。助けてください。