Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
执行以下代码段时,
sub list { my($self)=@_; my $file = $self->{P_Dir}."/".$self->{Name}; print `ls –l $file`; }
我收到此错误:
ls: cannot access –l: No such file or directory
我不确定是什么原因造成的,因为如果我在命令行中手动键入 ls -l,我看不到该错误。
Hmmm... It works for me though:
$ cat test.pl #!/usr/bin/perl -w use strict; my $file = "rpm.pl"; print `ls -l $file`; $ perl test.pl -rw-r--r-- 1 dheeraj dheeraj 922 2012-10-22 19:56 rpm.pl