【发布时间】:2012-07-25 04:09:40
【问题描述】:
我叫 luis,住在 arg。 我有一个问题,无法解决。
**IN BASH**
pwd
/home/labs-perl
ls
file1.pl file2.pl
**IN PERL**
my $ls = exec("ls");
my @lsarray = split(/\s+/, $ls);
print "$lsarray[1]\n"; #how this, i need the solution. >> file.pl
file1.pl file2.pl # but this is see in shell.
【问题讨论】:
-
如果你要
use warnings,perl 会警告你exec()之后的任何内容都不会被执行。 ("声明不太可能在...达成")