in reply to Perl/Apache Error

I can't tell just from your code what's going on, but you don't wamt to comment out "use strict".

Have you run the script from the command line to see what's happening? Is is printing out valid headers? My guess is that you tried to use an undeclared variable and your script died, thus not sending out proper headers.

I see that you have require 'parsform.cgi'; at the top of your code. You should really read this node for information why a hand-rolled CGI parsing routine is bad. Heck, post the form parsing routine and I'll point out all of the errors in it (and I'll bet a fair chunk of my salary that I can find errors in it).

Again, run the code from the command line and see what it puts out. Don't run scripts without strict and make sure that you enable warnings and taint checking (warnings can be disabled in production as they are not as important and have a performance penalty).

Cheers,
Ovid

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.

Replies are listed 'Best First'.
Re: (Ovid) Re: Perl/Apache Error
by fastkeys (Novice) on Feb 27, 2001 at 03:21 UTC
    Thanks for all your replys. This code is for a college computing asignment and we are supposed to use as little of other peoples code as possible. I know that there are huge advantages to using CGI.pm and for other stuff I would use it but if I can avoid it, it would be great as I can get more coding marks (besides, the server this is on only runs on my LAN behind a firewall so security is not a huge concern :) The parse_form that is required is the one by Craig Patchett & Matthew Wright from the CGI/Perl Cookbook.
      To add to the other voices, CGI is now included in the Perl distribution. It is, in effect, a part of the language. Using it is little different than using perl itself. And as others pointed out, burn that rotten book. There is better out there for less cash.

      --
      $you = new YOU;
      honk() if $you->love(perl)

      Not putting use CGI.pm; is like not putting #include <stdio.h> It's just not done that way.

      In other words, you're not really using other people's code, you're allowing yourself access to a well-accepted (some might even say universally accepted) API that helps you get your job done quicker. In other words, half the essence of programming.

      ALL HAIL BRAK!!!

      If your intent is to use as littleof other people's code as possible, at least make sure that it's good code. CGI.pm is good code. Matt Wright has a poor reputation in the security department (and in the Y2K department (and...)))