#!/usr/local/bin/perl # show.cgi - カウント数を表示 # Copyright (C) Takashi Utsunomiya. All Rights Reseved. # http://uttsu.com/ # 2002.08.18- # ver 1.00 2002.08.18 # ■init use strict; # カウントデータファイル my $data_file = "dat/count.dat"; my %count; main(); exit; # ■main sub main { get_count(); do_show(); } # ◆get_count sub get_count { open(IN, "$data_file") or die $!; foreach () { chomp; my ($file, $count) = split(/\t/); $count{$file} = $count; } close(IN); } # ◆do_show sub do_show { print <<"EOF"; Content-type: text/html; charset=Shift_JIS ダウンロード数一覧

ダウンロード数一覧

EOF foreach (reverse sort { $count{$a} <=> $count{$b} } keys %count) { print "
$count{$_}$_\n"; } print "
\n"; }