| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Text::Echelon; |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
Text::Echelon - get random Echelon related words. |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
use Text::Echelon; |
|
10
|
|
|
|
|
|
|
my $te = Text::Echelon->new(); |
|
11
|
|
|
|
|
|
|
print $te->get(); |
|
12
|
|
|
|
|
|
|
print $te->getmany($num); #or $te->getmany($num, $delimiter); |
|
13
|
|
|
|
|
|
|
print $te->makeheader(); |
|
14
|
|
|
|
|
|
|
print $te->makecustom($pre, $num, $post, $delim); |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 Using with mutt |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
If you want to generate an X-Echelon header on your outgoing mail, put the |
|
19
|
|
|
|
|
|
|
following in your .muttrc: |
|
20
|
|
|
|
|
|
|
C |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
F is supplied in this distribution. |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
Text::Echelon is a small program that will return Echelon |
|
27
|
|
|
|
|
|
|
'I', as per |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
F |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
If you don't know why you might want this, look at: |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
F |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
F |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 METHODS |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=cut |
|
40
|
|
|
|
|
|
|
|
|
41
|
1
|
|
|
1
|
|
863
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
41
|
|
|
42
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
43
|
|
|
43
|
1
|
|
|
1
|
|
21
|
use vars qw($VERSION); |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
377
|
|
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
$VERSION = '0.02'; |
|
46
|
|
|
|
|
|
|
my @Wordlist = ; |
|
47
|
|
|
|
|
|
|
chomp @Wordlist; |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head2 new |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Creates a new instance of Text::Echelon |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=cut |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub new { |
|
56
|
1
|
|
|
1
|
1
|
385
|
my $class = shift; |
|
57
|
1
|
|
|
|
|
3
|
my $self = bless {}, $class; |
|
58
|
1
|
|
|
|
|
2
|
return $self; |
|
59
|
|
|
|
|
|
|
}#new |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head2 get |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Returns one random spook word or phrase as a scalar |
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=cut |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub get { |
|
68
|
15
|
|
|
15
|
1
|
291
|
my $self = shift; |
|
69
|
15
|
|
|
|
|
79
|
return $Wordlist[rand($#Wordlist)]; |
|
70
|
|
|
|
|
|
|
}#get |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head2 getmany |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
Takes a number of spook words or phrases to be returned and the delimiter |
|
75
|
|
|
|
|
|
|
between words as parameters. Returns a scalar string of spookwords. |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=cut |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
sub getmany { |
|
80
|
4
|
|
|
4
|
1
|
908
|
my $self = shift; |
|
81
|
4
|
|
|
|
|
7
|
my ($num, $delim) = @_; |
|
82
|
4
|
|
100
|
|
|
14
|
$num ||= '3'; |
|
83
|
4
|
|
100
|
|
|
11
|
$delim ||= ', '; |
|
84
|
|
|
|
|
|
|
#join $delim, map $self->get (1 .. $num); |
|
85
|
4
|
|
|
|
|
4
|
my $str = ''; |
|
86
|
4
|
|
|
|
|
10
|
for(my $currnum = 1; $currnum <= $num; $currnum++) |
|
87
|
|
|
|
|
|
|
{ |
|
88
|
14
|
|
|
|
|
20
|
$str .= $self->get(); |
|
89
|
14
|
100
|
|
|
|
45
|
$str .= $delim unless ($currnum == $num); |
|
90
|
|
|
|
|
|
|
} |
|
91
|
4
|
|
|
|
|
19
|
return $str; |
|
92
|
|
|
|
|
|
|
}#getmany |
|
93
|
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head2 makecustom |
|
95
|
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
Takes four parameters - the prefix to use, the number of words or |
|
97
|
|
|
|
|
|
|
phrases to include, the postfix to use and the delimiter between words. |
|
98
|
|
|
|
|
|
|
Returns a scalar string. |
|
99
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=cut |
|
101
|
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
sub makecustom { |
|
103
|
2
|
|
|
2
|
1
|
303
|
my $self = shift; |
|
104
|
2
|
|
|
|
|
4
|
my ($pre, $num, $post, $delim) = @_; |
|
105
|
2
|
|
50
|
|
|
6
|
$pre ||= ''; |
|
106
|
2
|
|
50
|
|
|
9
|
$num ||= '3'; |
|
107
|
2
|
|
50
|
|
|
8
|
$post ||= ''; |
|
108
|
2
|
|
50
|
|
|
10
|
$delim ||= ', '; |
|
109
|
2
|
|
|
|
|
5
|
return $pre . $self->getmany($num, $delim) . $post; |
|
110
|
|
|
|
|
|
|
}#makecustom |
|
111
|
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=head2 makeheader |
|
113
|
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
Creates a header suitable for putting in your outgoing email. |
|
115
|
|
|
|
|
|
|
The scalar returned is in the format: |
|
116
|
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
C |
|
118
|
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=cut |
|
120
|
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
sub makeheader { |
|
122
|
1
|
|
|
1
|
1
|
636
|
my $self = shift; |
|
123
|
1
|
|
|
|
|
3
|
return $self->makecustom('X-Echelon: '); |
|
124
|
|
|
|
|
|
|
}#makeheader |
|
125
|
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=head1 AVAILABILITY |
|
127
|
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
It should be available for download from |
|
129
|
|
|
|
|
|
|
F |
|
130
|
|
|
|
|
|
|
or from CPAN |
|
131
|
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=head1 AUTHOR |
|
133
|
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
Russell Matbouli Etext-echelon-spam@russell.matbouli.orgE |
|
135
|
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
F |
|
137
|
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
=head1 TODO |
|
139
|
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
Create something more plausable - generate natural language. |
|
141
|
|
|
|
|
|
|
Ideally, a sentence generated randomly that contains spook words. |
|
142
|
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
=head1 LICENSE |
|
144
|
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
Distributed under GPL v2. See COPYING included with this distibution. |
|
146
|
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
148
|
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
perl(1). |
|
150
|
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
=cut |
|
152
|
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
#End, return true |
|
154
|
|
|
|
|
|
|
1; |
|
155
|
|
|
|
|
|
|
__DATA__ |