in reply to Apache::Htpasswd syntax questions

The source code is great, but could you explain your problem again? I missed that part.

Update:
If you're having issues with run-time errors, which can result in the "500 Internal Error" messages, then you should do two things:
  1. use CGI::Carp so you can see them in your appropriate error_log
  2. Try and run the script stand-alone, like: % ./script.cgi ''
This will make tracking down any source errors substantially easier.

Replies are listed 'Best First'.
Re: Re: Apache::Htpasswd syntax questions
by c (Hermit) on Aug 04, 2001 at 09:06 UTC
    I'll look into CGI::Carp, however I've tried running it from the command line which is another source of frustration for me. I am getting

    Use of uninitialized value at ./chpass.cgi line 39. Use of uninitialized value at ./chpass.cgi line 41. Use of uninitialized value at ./chpass.cgi line 22.

    These lines correspond to the

    22: $method->htpasswd($formdata{username}, $formdata{newpw}, $formdata +{oldpw});

    and the lines

    if ($ENV{'REQUEST_METHOD'} eq 'GET') { @pairs = split(/&/, $ENV{'QUERY_STRING'}); } elsif ($ENV{'REQUEST_METHOD'} eq 'POST') {

    at first I thought that it was the subroutine, however when I comment out the if statement:

    if ($formdata{username}) { $method->htpasswd($formdata{username}, $formdata{newpw}, $formdata{o +ldpw}); }

    the html is printed out correctly and the script runs. I've tried some other test to see if the subroutine was parsing the form values correctly and it appears that it is. Which brings me back to thinking that the problem is in the way I have used the module syntax.

    humbly -c

    Update I worked this script a little further. I eyeballed thatguy's code and saw some extra spaces I had put into my $method->htpasswd statement. When I removed them, the code worked. However, I put them back in, and it still worked, which left me scratching my head why. Regardless, I've added some error checking to the code apart from the module's. I'm putting the code up at my home node since It would be a bit long for here.

    enjoy -c