【发布时间】:2012-10-06 07:40:02
【问题描述】:
我有一个简单的 perl 脚本如下:
#!/usr/bin/perl
use strict;
use warnings;
print "hello world!\n";
我可以如下执行这个脚本:
>temp.pl
hello world!
>
如果我像这样添加一些 cmets:
#this script is just for test
#the shebang
#!/usr/bin/perl
use strict;
use warnings;
print "hello world!\n";
当我尝试执行时,它给我的输出如下:
> temp.pl
use: Command not found.
use: Command not found.
print: Command not found.
>
这里的重点是,无论如何,shebang 线都应该始终位于顶部。 谁能解释一下为什么?
【问题讨论】: