line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Acme::Scurvy::Whoreson::BilgeRat::Backend::lala; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
$VERSION = '1.0'; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
908
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
42
|
|
6
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
6
|
use base 'Acme::Scurvy::Whoreson::BilgeRat'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
357
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 NAME |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Acme::Scurvy::Whoreson::BilgeRat::Backend::lala - generate insults in the style of one of London.pm's bots |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 SYNOPSIS |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
use Acme::Scurvy::Whoreson::BilgeRat; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
my $insultgenerator = Acme::Scurvy::Whoreson::BilgeRat->new( |
19
|
|
|
|
|
|
|
language => 'lala' |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
print $insultgenerator; # prints a piratical insult |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 DESCRIPTION |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
The IRC channel #london.pm on the rhizomatic network used to have a bot, |
28
|
|
|
|
|
|
|
called Lala, that would insult you in her own inimitable style. |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
This is a backed for C that reproduces that style. |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
It's useless to anyone but this one particular project I'm working on. |
33
|
|
|
|
|
|
|
But since when has that stopped me? |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head1 AUTHOR |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
Simon Wistow |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
based on code by |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
Jonathan Stowe |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 COPYRIGHT |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Copyright 2005, Simon Wistow |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
Distributed under the same terms as Perl itself. |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 SEE ALSO |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
http://london.pm.org |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=cut |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub new { |
58
|
1
|
|
|
1
|
0
|
756
|
my $class = shift; |
59
|
|
|
|
|
|
|
|
60
|
1
|
|
|
|
|
1
|
my (@noun, @adj1, @adj2); |
61
|
|
|
|
|
|
|
|
62
|
1
|
|
|
|
|
2
|
my $pos = tell DATA; |
63
|
1
|
|
|
|
|
5
|
while() { |
64
|
49
|
|
|
|
|
42
|
chomp; |
65
|
49
|
50
|
|
|
|
90
|
next if /^\s*$/; |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
|
68
|
49
|
|
|
|
|
92
|
my ($adj1,$adj2,$noun) = split; |
69
|
|
|
|
|
|
|
|
70
|
49
|
|
|
|
|
57
|
push @adj1, $adj1; |
71
|
49
|
|
|
|
|
45
|
push @adj2, $adj2; |
72
|
49
|
|
|
|
|
113
|
push @noun, $noun; |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
1
|
|
|
|
|
7
|
seek DATA, $pos,0; |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
|
78
|
1
|
|
|
|
|
7
|
return bless { noun => \@noun, adj1 => \@adj1, adj2 => \@adj2 }, $class; |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
sub generateinsult { |
82
|
3
|
|
|
3
|
0
|
98
|
my $self =shift; |
83
|
3
|
|
|
|
|
4
|
my @adj1 = @{$self->{adj1}}; |
|
3
|
|
|
|
|
27
|
|
84
|
3
|
|
|
|
|
4
|
my @adj2 = @{$self->{adj2}}; |
|
3
|
|
|
|
|
15
|
|
85
|
3
|
|
|
|
|
3
|
my @noun = @{$self->{noun}}; |
|
3
|
|
|
|
|
16
|
|
86
|
|
|
|
|
|
|
|
87
|
3
|
|
|
|
|
81
|
return $adj1[rand @adj1] . " "; |
88
|
0
|
|
|
|
|
|
$adj2[rand @adj2] . " " . |
89
|
|
|
|
|
|
|
$noun[ rand @noun]; |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
1; |
92
|
|
|
|
|
|
|
__DATA__ |