我有一个非常简短的教程 perl 脚本:
#!/usr/bin/perl
print "The date is ",`date`;
print "The date is `date`",".\n";
$directory=`pwd`;
print "\nThe current directory is $directory.";
和输出:
The date is Sat Jul 2 17:04:58 PDT 2011
The date is `date`.
The current directory is total 20
-rwxr-xr-x 1 yan yan 433 2011-07-02 15:58 36
-rwxr-xr-x 1 yan yan 313 2011-07-02 16:29 43
-rwxr-xr-x 1 yan yan 116 2011-07-02 16:51 45
-rwxr-xr-x 1 yan yan 149 2011-07-02 16:53 46
-rwxr-xr-x 1 yan yan 145 2011-07-02 17:02 47
但如果我只是运行 pwd 我得到:
yan@ubuntu:~/bin/blackperl$ pwd
/home/yan/bin/blackperl
对这里的奥秘有什么合乎逻辑的解释吗?多谢!