Skip

上の動画が表示されていない場合はこちらよりフラッシュプレーヤーをダウンロードしてご覧ください。

count:#!/usr/local/bin/perl ######################################### #今日、昨日、トータルを集計する #2002/5/1作成 ######################################### #現在時間の取得 #(時差の修正:海外サーバのため)_ 2003/09/25 CHG S  *** @local_time= localtime(time); #@local_time= localtime(time+13*60*60); #_2003/09/25 CHG E ****************** $c_day= $local_time[3]; #カウント数を書き込むファイル指定、開く $count_file= "/home/littledog/domains/littledogpress.com/public_html/count/countv.dat"; open(FILE,"+<$count_file"); flock(FILE,2); $count= ; @count= split(/<>/,$count); $t_count= $count[0]; $y_count= $count[1]; $total_count= $count[2]; $today= $count[3]; #日付けが変わっていたら今日のカウントを昨日分にして今日のカウントを0に戻す。 if($today!= $c_day){ $y_count= $t_count; $t_count= 0; $today= $c_day; }else{ $today= $c_day; } $t_count++; $total_count++; $count="$t_count<>$y_count<>$total_count<>$today"; #カウントファイルに書き込み seek(FILE,0,0); print FILE "$count\n"; flock(FILE,8); close(FILE); print "\n"; #HTMLテキスト上に表示する部分 print "今日:$t_count 昨日:$y_count トータル:$total_count\n"; exit;