#!/usr/local/bin/perl ## Web COUNTER vol.1 (2000/04) ## Copyright(C) KENT WEB 1997-2000 ## webmaster@kent-web.com ## http://www.kent-web.com/ #============# # 設定項目 # #============# # 画像連結ライブラリ取込み require './gifcat.pl'; # ログファイル $logfile = "./count.dat"; # 画像ディレクトリ $gifdir = "./gif"; # 桁数 $digit = 6; #============# # 設定完了 # #============# # ログ読み込み open(IN,"$logfile") || &error("Open Error : $logfile"); $count = ; close(IN); # カウントアップ $count++; # ログ更新 open(OUT,">$logfile") || &error("Write Error : $logfile"); print OUT $count; close(OUT); # 桁数調整 while (length($count) < $digit) { $count = '0' . $count; } # 画像ファイルを文字列ごとに読み込み配列@GIFに格納 $length = length($count); @GIF=(); foreach (0 .. $length-1) { $n = substr($count,$_,1); push(@GIF,"$gifdir\/$n\.gif"); } # 画像表示 print "Content-type: image/gif\n\n"; binmode(STDOUT); print &gifcat'gifcat(@GIF); exit; #--------------# # エラー処理 # #--------------# sub error { die "$_[0] : $!"; }