【发布时间】:2013-05-05 22:47:59
【问题描述】:
我正在使用 AI::ExpertSystem::Advanced 从 Web 内容运行专家系统。
我有一个网站,我在其中使用以下代码运行 Perl 脚本:
use strict;
use warnings;
use AI::ExpertSystem::Advanced;
use AI::ExpertSystem::Advanced::KnowledgeDB::Factory;
use Data::Dumper;
use File::Slurp;
open(LOG, ">C:\\xampp\\htdocs\\xampp\\bc\\log.txt");
print LOG "START EXPERT\n";
system("C:\\Perl\\bin\\perl C:\\xampp\\htdocs\\xampp\\bc\\create_yaml.pl");
print LOG "START CREATE DB\n";
my $yaml_kdb = AI::ExpertSystem::Advanced::KnowledgeDB::Factory->new('yaml', {
filename => 'C:\\xampp\\htdocs\\xampp\\bc\\recepty.yaml'
});
print LOG "LOAD RECEPTY\n";
my $text = read_file(
'C:\\xampp\\htdocs\\xampp\\bc\\knowledgebase.yaml',
array_ref => 1,
chomp => 1
);
print LOG "LOAD DB\n";
my $ai = AI::ExpertSystem::Advanced->new(
viewer_class => 'terminal',
knowledge_db => $yaml_kdb,
initial_facts => $text
);
print LOG "NEW ES\n";
$ai->mixed();
print LOG "RESULT DONE\n";
#$ai->summary();
close LOG;
我试图创建一个日志。当我在终端中运行此源时,我的日志已满并且一切正常。但是当我从网络上运行它时,它是错误的。我的日志文件只有:
START EXPERT
START CREATE DB
LOAD RECEPTY
LOAD DB
我认为创建新专家系统的做法很糟糕。链接或者我不知道。你怎么看?
我的本地服务器错误:
Compilation failed in require at C:/Perl/lib/Term/ReadLine/Perl.pm line 65.
The system cannot find the path specified. Unable to get Terminal Size.
The Win32 GetConsoleScreenBufferInfo call didn't work.
The COLUMNS and LINES environment variables didn't work.
The resize program didn't work. at C:/Perl/lib/Term/ReadKey.pm line 362.
Compilation failed in require at C:/Perl/lib/Term/ReadLine/Perl.pm line 65.
【问题讨论】:
-
您查看过网络服务器的错误日志吗?
-
Compilation failed in require at C:/Perl/lib/Term/ReadLine/Perl.pm line 65. The system cannot find the path specified. Unable to get Terminal Size. The Win32 GetConsoleScreenBufferInfo call didn't work. The COLUMNS and LINES environment variables didn't work. The resize program didn't work. at C:/Perl/lib/Term/ReadKey.pm line 362. Compilation failed in require at C:/Perl/lib/Term/ReadLine/Perl.pm line 65.
标签: perl expert-system