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

Tim Mousel

Jun 4, 2000, 2:14 PM

Views: 1283
BUILT IN in-place editing?


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:

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;


Any suggestions would be greatly appreciated!