#!/afs/athena/contrib/perl/perl

sub makenewsidfile {
    local($file, $archive_name, $mid) = @_;
    local(%newsids, $idfaq);

    $mid =~ s/<>//g;
    open(NEWSIDF, $file);
    while(<NEWSIDF>){
	chop;
	($msgid, $archive) = split;
	if($archive eq $archive_name){
	    $newsids{$archive} = $mid;
	}
	else{
	    $newsids{$archive} = $msgid;
	}
    }
    unlink($file);
    open(NEWSIDF, ">$file");
    for $idfaq (keys %newsids){
	print("$newids{$idfaq} $idfaq\n");
    }
    close(NEWSIDF);
}
