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


Lingua-En-Victory documentation  | view source Contained in the Lingua-En-Victory distribution.

Index


NAME

Top

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

SYNOPSIS

Top

  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

Top

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

DESCRIPTION

Top

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

Top

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

COPYRIGHT AND LICENSE

Top


Lingua-En-Victory documentation  | view source Contained in the Lingua-En-Victory distribution.