Acme::Scurvy::Whoreson::BilgeRat - multi-lingual insult generator


NAME

Acme::Scurvy::Whoreson::BilgeRat - multi-lingual insult generator


SYNOPSIS

  use Acme::Scurvy::Whoreson::BilgeRat;

  my $insultgenerator = Acme::Scurvy::Whoreson::BilgeRat->new(
    language => 'pirate'
  );

  print $insultgenerator; # prints a piratical insult


DESCRIPTION

A multi-lingual insult generator, which takes pluggable backends to generate insults in the language of your choice, written in honour of International Talk Like A Pirate Day on Sept 19th 2003 http://www.talklikeapirate.com/. An example backend is provided which implements the 'pirate' language.

Usage is very simple. Instantiate an Acme::Scurvy::Whoreson::BilgeRat object, passing a single named parameter - 'language' - to the constructor. This tells it to use the A::S::W::B::Backend::[language] plugin module. If that is missing, we assume you want the 'pirate' backend.

To generate an insult, simply mention your object in any place where it will be turned into a string. It uses the AWESOME POWER of operator overloading to achieve this heroic feat.


PLUGINS

So, on to the most complex part of all this, which thankfully isn't that complex.

To create a plugin, you create a bog-standard module, whose name is Acme::Scurvy::Whoreson::BilgeRat::Backend::[your language name]. It should be a subclass of A::S::W::B. The constructor should return a blessed object and must be called new(). You then have two options:

use the built-in insult generator
In this case, you simply need to define a suitable grammar and list of words to generate insults from. You do this by having new() return a blessed hashref with the following keys:
grammars
A reference to a list of strings, each of which is a grammar describing a valid way of constructing an insult, and may consist of the letters 'A' and 'N'. A grammar is chosen at random when we generate an insult. For each part of the grammar, a random adjective is chosen for each 'A' and a random noun is chosen for each 'N'.

nouns
A list of nouns.

adjectives
A list of adjectives.

You may have words appearing in both the nouns and the adjectives lists. The default insult generator will ensure that it never uses the same word twice in any one insult. Of course, there are some situations where there are simply not enough nouns or adjectives in the grammar, in which case an empty insult is generated.

adjectives
A list of adjectives.

You may have words appearing in both the nouns and the adjectives lists. The default insult generator will ensure that it never uses the same word twice in any one T>

use thvessars
clDD> >grammars
dardr::W s">each two options: s">eaHowG>
item_e is csmarpartrely upando>athe A::S::W:tem_supp* an *d to defdjecmmacsmtem_suns: In ,. Tdsuppd ande wociomppcHioions:pDeturn escr
>
">ua to use ton::BilgeRat::Backend::[your la:Whoreson::Bilgeld be aNo :Whod to de'. The D> dr::Wcri

Us to dly isn'eard ives


o :Whod IG>nerator
es. ftw The( in w es-asDT>-beeeach o es-asDT>-speech) I anlsoG>payl thsgrr,ing inde'ecmporG>Us buall mtem_suns:< In mnowish gen,s. The dnONG>pDsingle named paramet dnto>SYNOPSISo :Whod Dng d Cdnto>dng d@ dnto>EM e laat::Backend::[your la:Whoreson:Scurvy::Whoreson::BilgeRao :Whod CScurvy::sing Dng d Cdnto>payl tescrt1n4-.or,eA0en/wish P> nedvenrasicialie'.ed In ,.ld ifmppcurd rur_owitem_anymsars