Use shebang line in the top of the program. It tells the kernel or Apache to interpret the file as a Perl script. and should put the use warnings;
and use strict;
in the top of the program
#!/usr/bin/perl
use warnings;
use strict;
print "hello world";
And more about shebang
Does the shebang determine the shell which runs the script?
Why should the shebang line always be the first line?