私はcpanを使用してPerlモジュールHTML :: Templateを実装しました。 Perl自身は、テンプレートモジュールを認識し、私はPerlのCGIスクリプトとして使用しようとすると、それは次のエラーをトリガ:PERL Web開発:Perlモジュールが見つかりませんでしたが、インストールされました
$ cat /var/log/httpd/error_log
[Tue Feb 14 11:28:27 2012] [error] [client 127.0.0.1] Can't locate HTML/Template.pm in @INC (@INC contains: /root/perl5/lib/perjl5/ /usr/local/lib/perl5 /usr/$
[Tue Feb 14 11:28:27 2012] [error] [client 127.0.0.1] BEGIN failed--compilation aborted at /var/www/cgi-bin/index.pl line 4.
[Tue Feb 14 11:28:27 2012] [error] [client 127.0.0.1] Premature end of script headers: index.pl
私のPerlスクリプト(index.pl)は以下の通りである:
#!/usr/bin/perl -w
use lib "/root/perl5/lib/perjl5"; # is it the correct way to include libs?
use HTML::Template; # error line
print "Content-type: text/html\r\n\r\n";
print "Hello there!<br />\nJust testing .<br />\n";
for ($i=0; $i<10; $i++)
{
print $i."<br />";
}
http://localhost/cgi-bin/index.plスクリプトをロードすると、500 Internal Server Errorが返されます。
モジュールがインストールされ、次の場所にあります。/root/perl5/lib/perl5/HTML/Template.pm
Infactは$ perldocのperllocalリターン:
[...]
[1mMon Feb 13 16:43:34 2012: "Module" HTML::Template[0m
· "installed into: /root/perl5/lib/perl5"
· "LINKTYPE: dynamic"
· "VERSION: 2.6"
· "EXE_FILES: "
[...]
それは正しくinstalle? は私が入力した場合: $ perlの-e "を使用するHTML ::テンプレート"エラーなしで助けるため
Im'usingのFedora 16
Linux version 3.2.5-3.fc16.i686 ([email protected]) (gcc version 4.6.2 20111027 (Red Hat 4.6.2-1) (GCC)) #1 SMP Thu Feb 9 02:24:08 UTC 2012
感謝を返すことです。