CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
BUILT IN in-place editing?

 



Tim Mousel
Deleted

Jun 4, 2000, 2:14 PM

Post #1 of 1 (574 views)
BUILT IN in-place editing? Can't Post

Hi,

For a membership script I'm trying to remove expired accounts.

$membershiplength = 30;
$expires = time() + (86400 * $membershiplength);
$current = time();

Here is the format of my data file:
$username:$password:$pass:$trans:$email:$expires:$date

I can't figure out how to delete the expired accounts from my file. I'm thinking something like the following but I think I'm way off:

sub delete_expired
{
use Fcntl ':flock'; # for LOCK_EX
open PASS, "<$password_file" &#0124; &#0124; &error('System Error. Password file was not able to be read.');
flock PASS, LOCK_EX;
$_ = do { local $/, <PASS> };
$expired = ????????
#print PASS;
close PASS;

exit;
}
}


Any suggestions would be greatly appreciated!

Tim

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives