Apache2-Authen-Passphrase
view release on metacpan or search on metacpan
use IO::Prompter [qw/-e* -stdio/];
die "Usage: aap-passwd [rootdir] username\n" if @ARGV == 0 || @ARGV > 2;
($Apache2::Authen::Passphrase::rootdir) = (shift =~ /(.*)/s) if @ARGV == 2;
my $username = shift;
die "Invalid username\n" unless $username =~ USER_REGEX;
($username) = ($username =~ /(.*)/s);
my $passwd = prompt 'Enter new Apache2::Authen::Passphrase password: ';
my $confirm = prompt 'Retype new Apache2::Authen::Passphrase password: ';
die "Sorry, passwords do not match\n" unless $passwd eq $confirm;
pwset $username, $passwd;
say 'Password updated successfully'; ## no critic (RequireCheckedSyscalls)
__END__
=head1 NAME
aap-passwd - passwd utility for Apache2::Authen::Passphrase
( run in 0.652 second using v1.01-cache-2.11-cpan-6aa56a78535 )