Terrence Brannon

NAME

Lingua::En::Victory - Perl extension for egotistically expressing victory.

SYNOPSIS

  use Lingua::En::Victory;

  my $v = Lingua::En::Victory->new;

  my $templates = $v->templates;
  for my $template (@$templates) {
     print $v->expr($template, $winner, $loser);
     print "\n";
  }

  print $v->rand_expr($template, $winner, $loser) for (1..5);

ABSTRACT

Lingua::En::Victory is a Perl extension for egotistically expressing victory.

DESCRIPTION

I developed a gaming site and got a little tired of reporting the results as "A beat B" so I wrote this module to spice up the results reporting.

METHODS

new()

This must be called first to create a Lingua::En::Victory object for use with the remaining API calls:

  my $v = Lingua::En::Victory->new;

templates()

This method returns a reference to the array of templates

  my $templates = $v->templates;

expr ($template, $winner_name, $loser_name)

This method fills in the given template with the winner and loser name:

  for my $template (@$templates) {
     print $v->expr($template, $winner, $loser);
     print "\n";
  }

rand_exp ($winner_name, $loser_name)

This method randomly selects one of the templates and fills it in with the winner and loser name.

EXPORT

None by default.

AUTHOR

T. M. Brannon, <tbone@cpan.org>

COPYRIGHT AND LICENSE

Copyright 2003 by T. M. Brannon

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.