Hi all, I'm having a frustrating error that I'm somewhat confused about. I'm writing a simple perl script as a cgi for a login. I've run through a lot of tests to try to figure out where the error is, but so far it's not been successful. The perl code is as follows:
#!/usr/bin/perl -wT use CGI; use CGI::Cookie; use CGI qw(:standard); use CGI::Carp qw(warningsToBrowser fatalsToBrowser); use Fcntl qw(:flock :seek); use Fcntl; use strict; my ( $name, #username they type in $pass, #password they type in $sys_name, #username in the member file $sys_pass, #password in the member file @members, #array of all members $dirto_members_list, #directory to members file $valid_name, #variable to determine name validity $valid_pass, #variable to determine password validity $cookie #cookie used to dtermine if they're log +ged in or not ); $name = param('username'); $pass = param('password'); print header; print start_html('Login Status'); ###################################################################### +### # Check the name & password in the members file ###################################################################### +### $dirto_members_list = "/home/hopefulc/public_html/cgi-bin/koh_members_ +list.cgi"; open (MEM, $dirto_members_list) || die("The File could not be opened!" +); #open the members file flock (MEM, LOCK_SH); seek (MEM, 0, SEEK_SET); @members = <MEM>; chomp (@members); close(MEM); + #close the members file $valid_name = 0; $valid_pass = 0; foreach my $mem (@members) { ($sys_name, $sys_pass) = split (/\|..\|/, $mem); if ($name eq $sys_name) { $valid_name = 1; if ($pass eq $sys_pass) { $valid_pass = 1; print "Congratulations $name, you logged in!\n<br><br>\n"; } else { print "Sorry, you didn't type in the correct password.\n<b +r><br>\n"; } } } ###################################################################### +#### print end_html;
The tests that I've run through include checking the file permissions and setting them to 0755, carefully checking the spelling in the files, checking the html form, and I also ran a slightly modified version of this code from the command line successfully. The annoying Internal Server error that is in the Apache error log is as follows: Mon Jun 16 17:56:46 2008 error client 76.193.171.114 File does not exist: /home/hopefulc/public_html/500.shtml The error seems very simple, except that I know the file does exist. If anyone has any suggestions to help it would be very much appreciated...

In reply to Perl CGI Apache help... by hopefulcd

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.