From: [EMAIL PROTECTED] > Now I need to define the username and password generated so that they > are written to the htaccess, htpasswd, and members.db file > > here is the script > <snipped> > # everything ok, let's write to database and send welcome email > open (DATABASE, ">>$database"); > flock (DATABASE, 2); > print DATABASE "$username|$password\n"; > flock (DATABASE, 8); > close (DATABASE);
1) Do not use the numbers, use named constants instead. What if the numbers are different on a different system? use Fcntl qw(:flock); flock (DATABASE, LOCK_EX); 2) Do NOT unlock the file. Simply close the filehandle and it'll be unlocked for you PROPERLY. If you do it like you did you could screw up the file. Keep in mind that the data you printed do not have to be writtent to the file already. They may still be in cache! Jenda =========== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ========== There is a reason for living. There must be. I've seen it somewhere. It's just that in the mess on my table ... and in my brain I can't find it. --- me -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]