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?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.