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


In reply to Re: Re: Apache::Htpasswd syntax questions by c
in thread Apache::Htpasswd syntax questions by c

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.