NAME
Chess::Mbox - write mbox files with chess games into them onto disk
SYNOPSIS
use Chess::Mbox;
sub post_op {
my @can = <*.can.pgn>;
my @pgn = grep { $_ !~ /can.pgn/ } <*.pgn>;
my $pgn = shift @pgn;
warn "PGN: $pgn CAN: @can";
system "/Users/metaperl/bin/annotate.pl $pgn" unless @can;
}
$M = '/Users/metaperl/Library/Mail/Mailboxes/Chess/Games.mbox/mbox';
$O = '/Users/metaperl/Documents/Chess/games/tmp';
Chess::Mbox->Parse (mbox => $M, output_dir => $O, post_op => \&post_op);
DESCRIPTION
This was a script lying on my disk that I thought would be useful to others. It simply takes a Unix mbox file and assumes each message is a chess game and writes to a directory with first directory == white and directory below that == black and the file name == date + time of match... after all you will have many rematches with a certain person. :)
It also will run a post_op
subroutine to do something with each
EXPORT
None by default.
AUTHOR
T. M. Brannon <tbone@cpan.org>