line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Bone::Easy; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
572
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
28
|
|
4
|
|
|
|
|
|
|
require Exporter; |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
497
|
use Bone::Easy::Rules; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
6
|
use vars qw($VERSION %Rules @EXPORT @ISA $Rules_Fh $Start_Kind); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
352
|
|
9
|
|
|
|
|
|
|
$VERSION = '0.04'; |
10
|
|
|
|
|
|
|
@ISA = qw(Exporter); |
11
|
|
|
|
|
|
|
@EXPORT = qw(pickup); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
$Rules_Fh = *Bone::Easy::Rules::DATA; |
14
|
|
|
|
|
|
|
load_rules(); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub load_rules { |
17
|
1
|
|
|
1
|
0
|
7
|
while(my $rule = <$Rules_Fh>) { |
18
|
770
|
100
|
|
|
|
1741
|
next unless $rule =~ /\S+/; |
19
|
|
|
|
|
|
|
|
20
|
673
|
|
|
|
|
700
|
chomp $rule; |
21
|
673
|
|
|
|
|
1004
|
$rule =~ s/\s+$//; |
22
|
|
|
|
|
|
|
|
23
|
673
|
|
|
|
|
1932
|
my($kind, $text) = $rule =~ /^(.*)-->(.*)$/; |
24
|
673
|
|
|
|
|
606
|
push @{$Rules{$kind}}, $text; |
|
673
|
|
|
|
|
2123
|
|
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
$Start_Kind = 'REMARK'; |
29
|
|
|
|
|
|
|
sub pickup { |
30
|
1
|
|
|
1
|
0
|
108
|
my $line = ${$Rules{$Start_Kind}}[rand @{$Rules{$Start_Kind}}]; |
|
1
|
|
|
|
|
38
|
|
|
1
|
|
|
|
|
3
|
|
31
|
|
|
|
|
|
|
|
32
|
1
|
|
|
|
|
5
|
return ucfirst replace($line); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub replace { |
36
|
5
|
|
|
5
|
0
|
7
|
my $line = shift; |
37
|
|
|
|
|
|
|
|
38
|
5
|
|
|
|
|
21
|
$line =~ s{(\b[A-Z]{2,}\b)} |
39
|
|
|
|
|
|
|
{ |
40
|
4
|
|
|
|
|
7
|
exists $Rules{$1} |
41
|
4
|
50
|
|
|
|
14
|
? replace(${$Rules{$1}}[rand @{$Rules{$1}}]) |
|
4
|
|
|
|
|
15
|
|
42
|
|
|
|
|
|
|
: $1 |
43
|
|
|
|
|
|
|
}eg; |
44
|
|
|
|
|
|
|
|
45
|
5
|
|
|
|
|
102
|
return $line; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=pod |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 NAME |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
Bone::Easy - Perl module for generating pickup lines. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 SYNOPSIS |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
use Bone::Easy; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
# I know you get this a lot, but what's a unholy fairy like you |
60
|
|
|
|
|
|
|
# doing in a mosque like this? |
61
|
|
|
|
|
|
|
print pickup, "\n"; |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 DESCRIPTION |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
Generates pickup-lines GUARANTEED to get something thrown in your face. |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 AUTHOR |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
Idea and original ruleset by TheSpark.com |
71
|
|
|
|
|
|
|
and Chris Coyne |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
Perl Code by Michael G Schwern |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 LICENSE |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
This program may be distributed under the same license as Perl itself, |
79
|
|
|
|
|
|
|
except for Bone::Easy::Rules. L for details. |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head1 SEE ALSO |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
L, L, L, L |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=cut |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
1; |