编辑test.pl
给test.pl行首加上头 #!/usr/bin/perl
上面#!后面的路径应该同which perl一致
chmod u+x test.pl
./test.pl
其实你可以直接perl test.pl执行,这样不需要设置chmod。