Well, if you are able, run the script from the command line. If your program fails to compile, that may be the problem.
Quick checklist:
- Correct permissions.
- Correct shebang line
- In the correct directory?
- Is a particular extension required (i.e., do you have myprog.pl instead of myprog.cgi)?
Another thing to do (in test only, don't use this for production), is to add the following line to the script:
use CGI::Carp qw(fatalsToBrowser);
If your script actually gets as far as compiling and the program tries to run, this will output the error messages to your browser, which aids debugging. Make sure that you take this out when you move the code to production as there is no sense in giving hackers additional information.
From what you are describing, it sounds like the problem is not with your code, but with the configuration. You have your code in the wrong place or something.
Is there any chance that you made corrections to your code that you forgot to upload to the server?
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.