in reply to Re: Apache::Htpasswd syntax questions
in thread Apache::Htpasswd syntax questions
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
|
---|