head 1.2; access; symbols; locks; strict; comment @# @; 1.2 date 2004.07.20.07.18.38; author rse; state Exp; branches; next 1.1; 1.1 date 2003.01.23.12.29.39; author rse; state Exp; branches; next ; desc @@ 1.2 log @fix usage @ text @## ## page.pl -- generate corresponding .html version for each .txt ## use strict; use IO::File; my @@PR = glob("PR-*.txt"); my $sidebar = 'Press Releases:

'; foreach my $pr (reverse sort @@PR) { my ($base, $name) = ($pr =~ m|^(PR-(.+))\.txt$|); next if ($name =~ m|^0000|); $sidebar .= "$name
"; } foreach my $pr (@@PR) { $pr =~ s|\.txt$||s; print "$pr\n"; my $io = new IO::File "<$pr.txt" or die; my $txt = ''; $txt .= $_ while (<$io>); $io->close; my $L = {}; my $x = $txt; $txt =~ s%^\s*\[(\d+)\]\s+((?:http|ftp)://\S+)%$L->{$1} = $2, ''%mge; $txt =~ s/&/&/sg; $txt =~ s//>/sg; $txt =~ s/((?:http|ftp):\/\/[^\s]+[^\s\.\)\&])/$1<\/a>/sg; $txt =~ s/([a-zA-Z0-9_.-]+\@@[^\s\)\&]+)/$1<\/a>/sg; $txt =~ s/^(\s*)([A-Z']{3,}\s+[A-Z]{2,}.+)$/$1$2<\/b>/mg; my $head = ''; $io = new IO::File "); $io->close; my $foot = ''; $io = new IO::File "); $io->close; $head =~ s|\@@TXT\@@|$pr.txt|sg; $head =~ s|\@@ID\@@|$pr|sg; $head =~ s|\@@SIDEBAR\@@|$sidebar|s; my $out = $head . "

\n" . $txt . "
\n" . $foot; $io = new IO::File ">$pr.html" || die; $io->print($out); $io->close; } @ 1.1 log @apply RSE cosmetics also to the press release area @ text @d7 1 a7 1 use IO; @