为什么perl反引号没有看到任何东西超过第一空间?

我有一个命令

$output = `somecommand parm1 parm2`; 

当我尝试运行这个Perl脚本,我得到。

 Can't exec "somecommand" at ..... 

看来它没有看到任何东西超出了“我有一个朋友在不同的环境中运行这个环境并且运行正常。

我可以在我的环境中有什么会导致这个? 我使用的Perl 5.20.0。

这可能是一个PATH问题? 这是一个运行echo命令的脚本,它位于我的$ PATH中。

 root@kt-wim-play:~# cat test.pl #!/usr/bin/perl -w use strict; print "PATH=$ENV{PATH}\n"; print "Running a command... [" . `echo foo bar baz` . "]\n"; root@kt-wim-play:~# perl test.pl PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin Running a command... [foo bar baz ] 

如果你正在尝试在perl中运行一个linux命令? 尝试这个。

 my $output = system("/path/to/command args"); 

http://www.perlmonks.org/?node_id=78523