ChangeLog

  どうも,土曜日の更新が少ないような気がして調べてみた.
  ちなみに,chalow からソースぱくりまくり.

#!/usr/bin/env perl

use strict;
use Time::Local;

my $fname = shift;

open(F, $fname) || die "file open error $fname : $!";
binmode(F);
my %day;
while (<F>) {
    if (/^(\d{4}-\d\d-\d\d)/) {
        eval { $day{get_day_of_week($1)}++; };
    }
}
close F;

my @week = qw(Sun Mon Tue Wed Thu Fri Sat);
foreach (@week) {
    printf "%s (%d) %s\n", $_, $day{$_}, '*' x $day{$_};
}

sub get_day_of_week {
    my ($d, $m, $y) = @_;
    ($y, $m, $d) = split("-", $d) unless (defined $m);
    my $WEEKDAY = (localtime timelocal(0, 0, 0, $d, $m - 1, $y))[6];
    return qw(Sun Mon Tue Wed Thu Fri Sat)[$WEEKDAY];
}


- 結果: 予想通り

Sun (48) ************************************************
Mon (72) ************************************************************************
Tue (64) ****************************************************************
Wed (69) *********************************************************************
Thu (68) ********************************************************************
Fri (60) ************************************************************
Sat (30) ******************************