LDAP user password reset script

Hey all,

I'm looking for a script to auto-generate a password for users that forget their password.

Currently, we are using a perl script (with cgi-bin) where users update their password, but would like to add to this and make it so that the users can also request a password reset and a generated password is emailed to the user and then they can go and update this on their own.

Does this make sense?

If you post (relevant parts of) the CGI script, I'm sure we can help.