sub DELETE { my $self = shift; my ($Id) = shift; my ($passwdFile) = $self->{PATH}; my (@cache); unless ($self->{CLOBBER}) { carp ("No write access for $self->{PATH}"); return; } if (!exists $self->{CURRENT}{$Id}) {return 1;} delete $self->{CURRENT}{$Id}; if (!open(FH,"<$passwdFile")) { carp("Cannot open $passwdFile: $!"); return; } flock(FH, 2); while () { if ( /^$Id\:/ ) { next; } else { push (@cache, $_); } } close FH; if (!open(FH,">$passwdFile")) { carp("Cannot open $passwdFile: $!"); return; } flock(FH, 2); while (@cache) { print FH shift (@cache); } close FH; return 1; }