Mercurial > mercurial > hgweb_porori.cgi
comparison Porori/src2/porori.pl @ 0:2b4fc52a96d9
porori.
| author | pyon@macmini |
|---|---|
| date | Wed, 12 Feb 2020 18:57:24 +0900 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:2b4fc52a96d9 |
|---|---|
| 1 use Time::Piece; | |
| 2 use Time::Seconds; | |
| 3 | |
| 4 my $today = localtime->ymd; | |
| 5 $today =~ s/-//g; | |
| 6 | |
| 7 print join ',' => "被保番", "氏名", "申請日", "区分", "開始日", "終了日", "期間", "\n"; | |
| 8 while (<>) { | |
| 9 chomp; | |
| 10 my ($h, $n, $s, $kbn, $d, $bgn, $end) = split /,/; | |
| 11 next if $d ne $today; | |
| 12 $kbn = "新規" if $kbn eq '01'; | |
| 13 $kbn = "更新" if $kbn eq '02'; | |
| 14 $kbn = "支介" if $kbn eq '10'; | |
| 15 $kbn = "区変" if $kbn eq '05'; | |
| 16 my $tbgn = Time::Piece->strptime($bgn, "%Y%m%d"); | |
| 17 my $tend = Time::Piece->strptime($end, "%Y%m%d"); | |
| 18 my $diff = $tend - $tbgn; | |
| 19 print join ',' => $h, $n, $s, $kbn, $bgn, $end, int $diff->months(); | |
| 20 print "\n"; | |
| 21 } | |
| 22 |
