为了账号安全,请及时绑定邮箱和手机立即绑定

Perl 反引号调用求助?

Perl 反引号调用求助?

红糖糍粑 2019-02-27 21:03:43
Perl 反引号调用求助
查看完整描述

3 回答

?
aluckdog

TA贡献1847条经验 获得超7个赞

my $cur_dir = `pwd`;
chomp($cur_dir);
my $file = "$cur_dir/bin/ProcessDir.exe";
if(-e $file){
my $str = `$file`; #see below comments:
print "str is $str \n";
}
#直接在windows cygwin下面调用返回正常,但通过CGI调用后$str返回为空string.
解决
把 $cur_dir 输出到网页上查看是什么内容。
用 print "$@ $! $^E $?\n" 看看这些变量都什么内容

查看完整回答
反对 回复 2019-03-30
?
侃侃无极

TA贡献2051条经验 获得超10个赞

用system或者反引号都可以
如:system("perl b.pl 1")

查看完整回答
反对 回复 2019-03-30
  • 3 回答
  • 0 关注
  • 655 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信