#!/usr/bin/perl # CountDown # ver.0.1 # generated by femc.org $cyear = "2005";#年 $cmon = "10"; #月 $cday = "30"; #日 $befor = "あと%s日"; #その日までメッセージ $now = "あと%s日!当日です"; #当日のメッセージ $after = "もう%s日過ぎてます"; #過ぎた後のメッセージ use Time::Local; ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);#時刻 $src = timelocal(0, 0, 0, $mday, $mon , $year + 1900); $dst = timelocal(0, 0, 0, $cday , $cmon - 1, $cyear); $exp = ($dst - $src) / 86400; print "Content-type: text/html\n\n"; #print "$cyear年$cmon月$cday日まで\n"; if($exp > 0) { printf($befor,$exp); }elsif($exp < 0) { $exp = abs $exp; printf($after,$exp); }elsif($exp == 0) { print $now; };