#!/usr/bin/perl $filename = '/home/scgyong/public_html/misc/yongmun/yongmun.txt'; main(); # end of execution sub main { setReplace(); print <<EOM; Content-type: text/html <HTML> <BODY BACKGROUND="yh.gif"> EOM open(FILE, $filename) or die $!; while (<FILE>) { my($qopen, $qclose); $qopen = $rep11 if (m/^\s*"/); $qclose = $rep12 if (m/"\s*$/); s/([^-\s"]+?)\(([^-\s"]+?)\)/$rep21\1$rep22\2$rep23/g; s/^\s*\n/<P>\n/; s/^-(.*)\n/\1<BR>\n/; s/\cM//; print $qopen; print; print $qclose; } close(FILE); print <<EOM; </BODY> </HTML> EOM } sub setReplace { $rep11 = <<EOM; <UL> <FONT COLOR="#007777"> EOM $rep12 = <<EOM; </FONT> </UL> EOM $rep21 = qq|<FONT COLOR="#0000FF">|; $rep22 = qq|</FONT>(<FONT COLOR="#007700">|; $rep23 = qq|</FONT>)|; } # end of script