#!/usr/bin/perl use strict; use warnings; ## Scott Wiersdorf ## Created: Fri Apr 13 11:07:10 MDT 2007 ## $Id: histmbox,v 1.1 2007/04/13 17:14:31 scott Exp $ ## create a histogram of mail by day ## ## usage: histmbox /path/to/mbox our $VERSION = 0.96; use HTTP::Date qw(parse_date); my %h = (); while( <> ) { next unless /^From \S+ (.+)$/; my($y, $m, $d, undef) = parse_date($1) or do { warn "Could not parse date '$1'\n"; next; }; $h{sprintf("%d%02d%02d", $y, $m, $d)}++; } print "$_: " . '#' x $h{$_} . " ($h{$_})\n" for sort keys %h;