in reply to First Script

Even though this is not a Perl-specific response, here is a list of http ErrorDocument types:

Where type is one of:

Incidentally, I tried your code and it works fine. If you uploaded the file from a PC, you may want to check for control M's. This has caught me in the past (before I learned vi). You will see the following in your file if this is the case:
^M
Mick

Replies are listed 'Best First'.
RE: Re: First Script
by Smash8 (Initiate) on Jul 18, 2000 at 00:36 UTC
    Mick, did you run the code yourself (if so, could you explain how) or did you run it off my website? Thanks
      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?

        Ovid, when I added the line

        use CGI::Carp qw(fatalsToBrowser);

        I got an error:
        Software error:
        Can't locate object method "new" via package "CGI" at .......
        So I presume that the program is compiling. And when I run it from the command line it's all good. Thanks a lot for helping a very bad perl programmer.

      I ran it (without any modifications) on my intranet webserver. It's an HP-UX running Netscape Suitespot server, if that helps. :-)

      Mick