I have a simple perl script as below:
#!/usr/bin/perl
use strict;
use warnings;
print "hello world!
";
I can execute this script as below:
>temp.pl
hello world!
>
If I add some comments like this:
#this script is just for test
#the shebang
#!/usr/bin/perl
use strict;
use warnings;
print "hello world!
";
and when I try to execute, it gives me output as below:
> temp.pl
use: Command not found.
use: Command not found.
print: Command not found.
>
The point here is the shebang line should be always at the top, no matter what.
Can anybody explain why?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…