我的名字是luis,住在arg。 我有一個問題,無法解決。Perl系統+分割+數組
**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.
如果你使用'warnings',perl會警告你'exec()'後面什麼都不會執行。 (*「聲明不太可能達到......」*) – pilcrow 2012-07-25 04:24:31