I just tried that on my own macosx (10.4.5 with perl 5.8.6), and the apache server had no problem with it at all (I got "Hello, Word" in the browser).
I've never seen "Exec format error" before, though there do seem to be a number of references you can find if you google that string. Does /usr/bin/perl work for you from the command line? (And does that script work from the command line, if you just type /Library/WebServer/CGI-Executables/first.pl at the shell prompt?) Based on the few google hits I've looked at for this error message, I would expect the command line usage to fail just like the web-server usage.
Are you sure that the shebang line ends with just a line-feed (LF, 0x0a), rather than anything involveing a carriage-return (CR, 0x0d)? (Check it using the "od" command; also try changing it to #!/usr/bin/perl -T)
I doubt that httpd.config has anything to do with it (I don't think anyone here wants to review that), but you should probably check it over on your own.
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.