>>115 #!/usr/local/bin/perl -w
use strict;
use CGI qw(header start_html table Tr td end_html);
use CGI::Carp qw(fatalsToBrowser);
my $file = 'log.txt';
my $charset = 'Shift_JIS';
my %count;
{
local *FH;
-f $file or die "No such file.\n";
open FH, '<' . $file or die $!;
while (<FH>) { ++$count{$_} for /「(.*?)」/g }
close FH;
}
print
header(-charset => $charset),
start_html(-encoding => $charset, -lang => 'ja'),
table( Tr([ map td([ $_, $count{$_} ]), sort keys %count ]) ),
end_html,
;
__END__