Greetings all,
I've got a mandrake 9.1 box that I've been using as a development server. Last night I tried running a test script (hello world) to make sure my setup is working (apache 2, perl 5.8.0, mandrake 9.1 on a AMD K6 533 Mhz, 384 MB Ram) and got a syntax error... here's what I tried:
#!/usr/bin/perl -w
use strict;
print("Content-type: text/html\n\n");
print("Hello!");
It tells me there's a syntax error on line 4 near the first print call. After scratching my head for an hour and playing around I found that running it inline gives the same problem. I also found out that if I substitute "#!/bin/sh" for "#!/usr/bin/perl -w" and replace "print('Content-type: text/html\n\n');" with "echo Content-type: text/html\n\n" all is well. I know perl's installed in the /usr/bin/perl folder of my computer, but the typical #!/usr/bin/perl just doesn't work.
Not being a fan of rpms, and never having installed Perl myself, I downloaded the latest (5.8.4), compiled and installed... and same thing. I'm sure I'm missing something simple, since I can't find similar issues on google or here. But since I'm fairly noob at Linux administration, I'm at a loss. Any thoughts?