YA Perl Advent Calendar 2005-12-17

As is tradition around this time of the calendar, we bring you a module devoid of almost any practical value which you are sure to love–that is if you can get it, or rather its dependencies, installed–Acme::POE::Knee. Despite the POD-page's statement, POE::Knee is a sort of retro-homophone and not an acronym. But what is POE::Knee? It's a lot like using the company mainframe to find someone without a sixth degree of Kevin Bacon. POE::Knee uses Perl and POE to race virtual horses.
Starting pony    Blitzen
Starting pony      Comet
Starting pony      Vixen
Starting pony     Donner
Starting pony    Prancer
Starting pony      Cupid
Starting pony      Olive
Starting pony    Rudolph
Starting pony     Dasher
Pony     Donner has reached stage   1
Pony      Comet has reached stage   1
Pony     Dasher has reached stage   1
Pony    Rudolph has reached stage   1
Pony    Blitzen has reached stage   1
Pony    Blitzen has reached stage   2
Pony    Rudolph has reached stage   2
Pony    Blitzen has reached stage   3
Pony      Comet has reached stage   2
Pony    Prancer has reached stage   1
Pony     Dasher has reached stage   2
Pony      Cupid has reached stage   1
Pony     Donner has reached stage   2
Pony    Rudolph has reached stage   3
Pony    Rudolph has reached stage   4
Pony      Vixen has reached stage   1
Pony     Dasher has reached stage   3
Pony    Blitzen has reached stage   4
Pony      Olive has reached stage   1
Pony    Rudolph has reached stage   5
Pony    Prancer has reached stage   2
Pony    Rudolph has reached stage   6
Pony      Cupid has reached stage   2
Pony      Comet has reached stage   3
Pony    Blitzen has reached stage   5
Pony     Donner has reached stage   3
Pony     Dasher has reached stage   4
Pony     Donner has reached stage   4
Pony    Rudolph has reached stage   7
Pony    Blitzen has reached stage   6
Pony      Vixen has reached stage   2
Pony     Dasher has reached stage   5
Pony      Cupid has reached stage   3
Pony    Rudolph has reached stage   8
Rudolph won the race!

mod17.pl


   1 use Acme::POE::Knee;
   2 
   3 $stable = new Acme::POE::Knee(
   4 			      dist        => 7,         # Days until Xmas eve
   5 			      ponies  => {
   6 					  Dasher=>1.4,  # Weights are my
   7 					  Prancer=>1.2, # Guesstimation of
   8 					  Vixen=>1.7,   # "popularity"**-1
   9 					  Comet=>1.5,   # or forgetability
  10 					  Cupid=>1.6,
  11 					  Donner=>1.1,
  12 					  Blitzen=>1.3,
  13 					  Rudolph=>1.0,
  14 					  Olive=>2
  15 					 },
  16 			     );
  17 $stable->race;