open(FFILES, $fnFiles) || die "Can't open $fnFile: $!"; while () { chop; ($label, $path) = split; &readCountFile($label, $path); } foreach $labeldate (sort(keys(%count))) { print "$labeldate\t$count{$labeldate}\n"; } # 1 2 3 4 5 6 7 [8 9 10 11 ...] # Wed Jan 30 20:28:20 JST 1998 5001 [HOST URL REFERER1 REFERER2 ...] sub readCountFile { local($label, $path) = @_; print STDERR "process $label: $path\n"; open(FCOUNT, $path) || die "Can't open $path: $!"; while () { chop; ($ww, $monstr, $dd, $timestr, $locale, $yy, $nn, $host, $prevurl, $referer) = split; $mm = $arrayMonthStr{$monstr}; $count{"$label\t$yy\t$mm"}++; } }