#!/usr/local/bin/perl -w # *** # *** CGI script: static PDOS publication list # *** Eddie Kohler, June 10, 1999 # *** # *** Take a look at PDOSBib.pm # *** to change things like people's URLs # *** and how different bibliography entries are generated # *** # *** Take a look at PDOSCGI.pm # *** to change where files are located # *** #use lib '/home/am0/httpd/htdocs/pdosbib'; use BibTeX; use PDOSBib; use PDOSCGI; sub do_entries () { my($section, $key, $d); foreach $section (@sections) { # print section header print '

'; print $section, "

\n"; print "\n"; } } sub do_sections () { foreach $section (@sections) { print '

', $section, "

\n"; } } # main program if (@ARGV > 0) { open(BIB, $ARGV[0]) || die "can't open $ARGV[0]"; } else { open(BIB, "<&STDIN"); } $e = BibTeX::parse(*BIB, %initial_strings); close BIB; if (@ARGV > 1) { open(STDOUT, ">$ARGV[1]") || die "can't open $ARGV[1]"; } # make sections @sections = (); foreach $key (@{$e->{'_'}}) { next if dont_print($e->{$key}); $section = $e->{$key}->{'www_section'}; if (not $section) { $e->{$key}->{'www_section'} = $section = "Miscellaneous"; } if (!exists $sections{$section}) { push @sections, $section if $section ne ''; $sections{$section} = 1; } } push @sections, 'Miscellaneous' if $sections{''} && !$sections{'Miscellaneous'}; ## PRINT STUFF! $argv_string = join(' ', 'mkpdospubs.pl', @ARGV); print <<"EOD;"; Anonymity Bibliography

Anonymity bibliography

By subject | By date



Publication search:


Subjects:
EOD; ## PRINT SECTIONS do_sections; print <<"EOD;";

Publications by subject

EOD; ## PRINT ENTRIES do_entries; print <<"EOD;";

EOD;