#!/usr/bin/perl # Make individual publication lists. # load author list: open(AUTH, ") { chop; ($login, $author) = /(\w*)\s(.*)/; $author{$login} = $author; } @login=keys(%author); close(AUTH); # endnote/refer files open (REF, ") { #accumulate fields of entry $entry = $entry . $_; #accumulate author and editor names $x = ""; if (($x) = /^%[A,E]\s*(.*)/) {$authors= $authors . " " . $x;} # end of record: load into list if (/^\s?$/) { # end of entry $authors[$refnum] = $authors; $entry[$refnum] = $entry; $refnum[$refnum]=$refnum; $refnum++; $entry = ""; $authors = ""; } } # make bibliography files for each member of pcm foreach $login (@login) { open (OUT, ">people/".$login.".end"); @variants = split(' ', $author{$login}); foreach $author (@variants) { @idx = grep {$authors[$_] =~ /$author/} @refnum; } foreach $i (@idx) { print OUT $entry[$i]; } close(OUT); } __END__