NAME
Games::Golf - Utilities to administer Perl Golf courses
SYNOPSIS
use Games::Golf;
my $golf = new Games::Golf ( referee => "Bob the Referee",
referee_mail => 'bob@referee.org'
holes => [ qw( name1 name2 ) ],
deadline => "2002/02/20",
);
$golf->read( "entries.dat" );
$golf->extract( "mbox" );
$golf->test;
$golf->dump( "entries.dat" );
$golf->print_report;
$golf->mail_report( 'fwp@perl.org' );
Or, interactive:
perl -MGames::Golf -e shell
DESCRIPTION
The game of Perl golf is becoming increasingly popular. Holes frequently appear on Perl Monks, the Perl Review has an ongoing Perl Golf colunm, and the Fun with Perl mailing-list has run several very successful courses in the last few months, with great success.
Until now, judges have had to write extensive test programs to check and score the players' entries along with compiling the leaderboard by hand.
This module aims at facilitating the administration of Perl golf courses by writing a simple configuration file and writing the test programs as .t files.
The included scripts will test a player's individual entries, doing all the hard scoring and testing for the judge. Methods to compute statistics and leaderboards are also provided.
The Games::Golf
object will handle a list of Games::Golf::Entry
objects.
CONSTRUCTOR
- new( [ARGS] )
-
Creates a new
Games::Golf
object. Parameters are:referee Name of the referee. referee_mail Mail of the referee (where solutions will be sent). deadline Closing date of the game. Any format welcome. holes Array ref to the names of the holes.
METHODS
- extract( "/path/to/mbox", ... )
-
Extracts solutions from a unix-style mbox. A cache mechanism allows the
Golf::Game
object not to extract already extracted entries. - test()
-
Tests entries of the game. A cache mechanism allows the Golf::Game object not to check already tested entries.
!!FIXME!! We must now investigate further on the format of the test suite. And have an example of such a test.
- dump( "/path/to/data" )
-
Dumps all entries in a single file.
Dies if there's a problem.
- load( "/path/to/data" )
-
Reads a file with all previously recorded entries. See the
dump
method. This initiates the cache mechanism.Dies if there's a problem.
- print_report( [*FH] )
-
Prints the current leaderboard on STDOUT. If
*FH
is supplied, use this filehandle instead. - mail_report( 'mail@adress.com', ... )
-
Mails the leaderboard to the specified adresses.
- shell
-
Interactive play for both a golfer and the arbiter.
ENVIRONMENT VARIABLES
PERL_GOLF_SMTP_SERVER
This variable can be set to indicate which server is to be used to send solutions or report.
!!FIXME!! What if the user wants to use a sendmail-based solution?
PERL_GOLF_NICK
Specifies the name to be printed on the leaderboard instead of the mail adress of the golfer.
PERL_GOLF_CATEGORY
This one can be set to indicate if golfer is experienced (default, "veteran") or a newcomer that would set it to "beginner".
FILES
tests/*.t
The test suite for a golf course.
!!FIXME!! "tests/*" or "t/*"? t/* will already be taken by the module...
extracted/*
The directory where to store extracted entries.
!!FIXME!! Should we allow an environment variable to overwrite this?
DEPENDENCIES
Date::Manip
to handle dates the smart way.Data::Dumper
to easily dump and fetch our entries.MD5
to implement our cache mechanism.
TODO
Lots of stuff.
AUTHORS
- Philippe 'BooK' Bruhat <book@cpan.org>
- Dave Hoover <dave@redsquirreldesign.com>
- Steffen Müller <tsee@gmx.net>
- Jonathan E. Paton <jonathanpaton@yahoo.com>
- Jérôme Quelin <jquelin@cpan.org>
- Eugène Van der Pijll <E.C.vanderPijll@phys.uu.nl>
COPYRIGHT
This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.
SEE ALSO
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 365:
Non-ASCII character seen before =encoding in 'Müller'. Assuming CP1252