Acme-Scurvy-Whoreson-BilgeRat-Backend-insultserver
view release on metacpan or search on metacpan
lib/Acme/Scurvy/Whoreson/BilgeRat/Backend/insultserver.pm view on Meta::CPAN
package Acme::Scurvy::Whoreson::BilgeRat::Backend::insultserver;
$VERSION = '1.0';
use warnings;
use strict;
use base 'Acme::Scurvy::Whoreson::BilgeRat';
=head1 NAME
Acme::Scurvy::Whoreson::BilgeRat::Backend::insultserver - generate insults in the style of the old colarado.edu Insult Server
=head1 SYNOPSIS
use Acme::Scurvy::Whoreson::BilgeRat;
my $insultgenerator = Acme::Scurvy::Whoreson::BilgeRat->new(
language => 'insultserver'
);
print $insultgenerator; # prints an insult
=head1 DESCRIPTION
We used to have the Insult Server at http://insulthost.colorado.edu
which you could telnet to on port 1695 to get a random insult. And Lo!
it was fun.
Useless, but fun.
Sadly, it's down now. This is a reimplementation in Perl.
=head1 BUGS
Should be able to specify another config file, possibly though environment variables.
=head1 AUTHOR
Simon Wistow <simon@thegestalt.org>
based on code by
James Garnett <garnett@colorado.edu>
=head1 COPYRIGHT
Copyright 2005, Simon Wistow
Distributed under the same terms as Perl itself.
=head1 SEE ALSO
http://insulthost.colorado.edu/
=cut
sub new {
my $class = shift;
my $self = {};
my $pos = tell DATA;
while(<DATA>) {
chomp;
next if /^\s*$/;
next if /^\s*#/;
next unless s!^\s*(adj|amt|noun)\s+!!i;
my $what = $1;
# turn the '|' character into a space
( run in 1.708 second using v1.01-cache-2.11-cpan-d80b1682f3f )