#!/usr/bin/perl # list all glossary items for update $DataFile = '../data/cgIndex.dat'; $SpecFile = '../data/qqq.dat'; #$lsp = 'ZZ'; $fsp = 'QQ'; $ArialFace = 'FACE="Arial, Helvetica, sans-serif"'; # get existing special cases : cTitle ending with a 'Q' %Special = (); if (open(SPEC, $SpecFile)) { while ($SpecItem = ) { chomp $SpecItem; $Special{$SpecItem} = '1'; } close SPEC; } print <<_ENDPRINT; Content-type: text/html Buddhist Door Glossary Update

Buddhist Door Glossary
Update

_ENDPRINT ### get all items %CTitles = (); @Titles = (); if (open (GLOS, $DataFile)) { while ($Line = ) { chomp $Line; ($ETitle, $Key, $CTitle, $Def) = split /$fsp/, $Line, 4; # special case for e.g. 'Contemplation', key 'contempl' # the last Chinese char ends with a 'Q' if (defined($Special{$Key})) { $CTitle .= 'Q'; $Def = substr($Def, 1); } # store titles for sorting # a little elaborate but allows duplicate ETitle's $CTitles{$Key} = $CTitle; push @Titles, "$ETitle QQ $Key"; } close GLOS; } else { print <<_ENDPRINT; Sorry, the glossary is not available at this time.
Please try later.
Return to main menu page.
_ENDPRINT exit; } # if open # sort titles @Titles = sort @Titles; # print selection list print <<_ENDPRINT;

Select an entry to update:

   

_ENDPRINT exit;