Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

I'm not getting the same behaviour on my box.

I notice that you're not checking the return values of htpasswd. The method can fail, so looking at the return values might give you a clue ;-)

The following test script runs fine on my box...

#! /usr/bin/perl use strict; use warnings; use Apache::Htpasswd '1.5.4'; use Test::More tests => 13; my $TEST_FILE = "test_htpasswd.txt"; die "$TEST_FILE file already exists\n" if -e $TEST_FILE; # setup our test fixture { open(FILE, '>', $TEST_FILE) or die; close(FILE) or die; my $pwd = new Apache::Htpasswd($TEST_FILE); foreach (1..6) { $pwd->htpasswd("user$_", "pass$_") or die "failed to add user$_ " . $pwd->error . "\n"; }; }; my $pwd = new Apache::Htpasswd($TEST_FILE); foreach my $n (1..6) { ok($pwd->htCheckPassword("user$n", "pass$n"), "user $n added"); }; ok($pwd->htpasswd('user3', 'newpwd3', 1), "password for user3 changed" +) or diag "error reported was " . $pwd->error; foreach my $n (1..6) { my $pass = ($n==3) ? "newpwd3" : "pass$n"; ok($pwd->htCheckPassword("user$n", $pass), "user $n still valid"); }; unlink $TEST_FILE or die "could not unlink $TEST_FILE\n";

In reply to Re: Strange behaviour in Apache::Htpasswd::htpasswd() by adrianh
in thread Strange behaviour in Apache::Htpasswd::htpasswd() by George_Sherston

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others avoiding work at the Monastery: (3)
    As of 2021-03-07 03:46 GMT
    Find Nodes?
      Voting Booth?
      My favorite kind of desktop background is:

      Results (119 votes). Check out past polls.