a****g 发帖数: 6 | 1 我想在perl cgi 中运行一个C程序并得到其结果(name: exe_prog ,输出结果是一个 int array).
当我单独运行exe_prog时,结果如下:
》exe_prog
12 13 14 16 17 19 21
my CGI script is :
...
unless (open PIPE, "exe_prog |" ) {
print "can't open file";
}
$result = ;
close (PIPE);
...
但打开时,总显示 "can't open file".
但当我单独写一个同样的perl 程序 perl_prog.pl :
unless (open PIPE, "exe_prog |" ) {
print "can't open file";
}
$result = ;
close (PIPE);
并运行时,结果正常:
》perl_prog.pl
12 13 14 16 17 19 21
(all files in the same dire | a****f 发帖数: 29 | 2 看看是否是`路径问题, 如执行文件路径和 sh 的路径.
在cgi 下很多 env 变量是没有的.
【在 a****g 的大作中提到】 : 我想在perl cgi 中运行一个C程序并得到其结果(name: exe_prog ,输出结果是一个 int array). : 当我单独运行exe_prog时,结果如下: : 》exe_prog : 12 13 14 16 17 19 21 : my CGI script is : : ... : unless (open PIPE, "exe_prog |" ) { : print "can't open file"; : } : $result = ;
|
|