File Coverage

blib/lib/Acme/MetaSyntactic/soviet.pm
Criterion Covered Total %
statement 25 25 100.0
branch 10 10 100.0
condition 3 3 100.0
subroutine 5 5 100.0
pod n/a
total 43 43 100.0


line stmt bran cond sub pod time code
1             # -*- encoding: utf-8; indent-tabs-mode: nil -*-
2             #
3             # Acme::MetaSyntactic::soviet -- NATO codenames for Soviet-designed equipment
4             # Copyright (C) 2008, 2012, 2016, 2021 Jean Forget
5             #
6             # See the license in the embedded documentation below.
7             #
8             package Acme::MetaSyntactic::soviet;
9              
10 13     13   84207 use warnings;
  13         27  
  13         438  
11 13     13   62 use strict;
  13         26  
  13         245  
12              
13 13     13   5574 use Acme::MetaSyntactic::MultiList;
  13         41206  
  13         4184  
14             our @ISA = qw( Acme::MetaSyntactic::MultiList );
15             our $VERSION = '0.06';
16              
17             my $data = { default => 'electronic' };
18             my ($category2, $category3);
19             my %seen;
20              
21             _load_data_from_pod();
22              
23             __PACKAGE__->init($data);
24              
25             sub _load_data_from_pod {
26              
27 13     13   77 while () {
28 21554 100       60909 if (/^=head2\s+(.*)/) {
    100          
    100          
    100          
29 26         67 _flush_category();
30 26         85 $category2 = lc($1);
31 26         131 $category3 = '';
32             }
33             elsif (/^=head3\s+(.*)/) {
34 91         227 _flush_category();
35 91         672 $category3 = lc($1);
36             }
37             elsif (/=item\s+(.*?)\s*$/) {
38 4966         8478 my $name = $1;
39 4966         9356 $name =~ s/\s+/_/g;
40 4966         8505 $name =~ s/_+/_/g;
41 4966         14517 $seen{$name} = 1;
42             }
43             elsif (/^=head1/) {
44 13         41 last;
45             }
46             }
47 13         38 _flush_category();
48             }
49              
50             sub _flush_category {
51 130 100 100 130   434 if ($category2 and %seen) {
52 91         2105 $data->{names}{$category2}{$category3} = join ' ', sort keys %seen;
53             }
54 130         763 %seen = ();
55             }
56              
57             38;
58             # Why 38? Hint: s/r$/t/
59              
60             =encoding utf8
61              
62             =head1 NAME
63              
64             Acme::MetaSyntactic::soviet -- NATO codenames for Soviet-designed equipment
65              
66             =head1 DESCRIPTION
67              
68             Some codenames given by NATO to Soviet-designed aircraft, missiles,
69             submarines, radars and other electronic systems. The various
70             categories and sub-categories are
71              
72             =over 4
73              
74             =item *
75              
76             electronic
77              
78             =item *
79              
80             electronic/radars
81              
82             =item *
83              
84             electronic/misc
85              
86             =item *
87              
88             vehicles
89              
90             =item *
91              
92             vehicles/aircraft
93              
94             =item *
95              
96             vehicles/helicopters
97              
98             =item *
99              
100             vehicles/missiles
101              
102             =item *
103              
104             vehicles/submarines
105              
106             =item *
107              
108             vehicles/error
109              
110             =back
111              
112             The default category is 'electronic'.
113              
114             =head1 VERSION
115              
116             This is version 0.06, the Fresco version, released on the 49th
117             anniversary of the dogfight between a MiG-17 Fresco flown by ace
118             Colonel Tomb and a F-4 Phantom flown by soon-to-be-aces Cunningham and
119             Driscoll
120              
121             =head1 SYNOPSIS
122              
123             use Acme::MetaSyntactic;
124              
125             my $meta = Acme::MetaSyntactic->new( 'soviet' );
126              
127             print $meta->name(); # return a single name
128             my @names = $meta->name( 4 ); # return 4 distinct names (if possible)
129              
130             If you want some category other than 'electronic', the second line should
131             read:
132              
133             my $meta = Acme::MetaSyntactic->new( 'soviet', category => 'vehicle/aircraft' );
134              
135             If C from L is installed, you can use it
136             from the command line:
137              
138             meta soviet
139              
140             meta soviet/vehicles/submarines
141              
142             =head1 CONTRIBUTOR
143              
144             Jean Forget
145              
146             =head1 SOURCES
147              
148             Note: I have used only sources published I the fall of the
149             Soviet Union. Therefore, the module name is C, with no
150             "ex-" prefix. For each entry, the sources are listed, with page
151             numbers for most books. The games use data cards, which are
152             unnumbered.
153              
154             Some sources, especially early sources, may contain some errors. Some
155             equipment may appear with faulty intelligence reports which give a
156             wrong code or description. And a later intelligence report would
157             correct it. The best example is the Backfire, first given the code
158             "Tu-26" and then the code "Tu-22M".
159              
160             =head2 Main Sources
161              
162             These sources contain extensive lists or extensive tables of soviet
163             equipment.
164              
165             =over 4
166              
167             =item *
168              
169             I
170             written by J-J Patry and P. Lederer
171             published by Editions Presse & Recherche
172             abbreviated as I.
173              
174             =item *
175              
176             I
177             written by Derek Wood
178             published by Janes in 1987
179             (ISBN 0-7106-0343-6)
180             abbreviated as I.
181              
182             =item *
183              
184             I
185             designed by J.D. Webster
186             and published by GDW in 1987
187             (ISBN 0-943580-19-6) see
188             L
189             abbreviated as I.
190              
191             =item *
192              
193             I
194             designed by J.D. Webster
195             and published by GDW in 1987
196             (ISBN 0-943580-30-7), see
197             L
198             abbreviated as I.
199              
200             =item *
201              
202             I
203             designed by J.D. Webster
204             and published by GDW in 1988
205             (ISBN 0-943580-97-8), see
206             L
207             abbreviated as I.
208              
209             =item *
210              
211             I
212             written by H. Le Masson
213             published by Editions Maritimes et Outre-Mer
214             (no ISBN)
215             abbreviated as I.
216              
217             =item *
218              
219             I
220             written by B. Prézelin
221             published by Editions Maritimes et Outre-Mer
222             (ISBN 2.7373.0485.7)
223             abbreviated as I.
224              
225             Note: these last two books are actually the same book, updated and
226             published every other year. You can notice that the title has been
227             shortened between the 1968 issue and the 1990 issue (FDC vs. LFDC).
228              
229             =item *
230              
231             I
232             written by Victor Flintham
233             published by Arms and Armour in 1989
234             (ISBN 0-85368-779-X)
235             abbreviated as I.
236              
237             =item *
238              
239             I
240             designed by David Isby
241             published in 1977 by SPI and then in 1983 by TSR
242             (no ISBN), see
243             L
244             abbreviated as I.
245              
246             =item *
247              
248             I
249             written by James F. Dunigan
250             published by Quill in 1988
251             (ISBN 0-668-07979-2)
252             abbreviated as I.
253              
254             =item *
255              
256             I special issue I
257             published by Excelsior Publications SA in May 1977
258             abbreviated as I.
259              
260             =item *
261              
262             I
263             (or I)
264             written by Bill Gunston
265             published by Salamande Books Ltd. in 1987
266             (ISBN 0-86101-314-X)
267             abbreviated as I.
268              
269             =back
270              
271             =head2 Minor Sources
272              
273             These sources mention some NATO codes for soviet equipment, but
274             without trying to give an exhaustive list of some category or other.
275              
276             =over 4
277              
278             =item *
279              
280             I
281             designed by Steve Weiss
282             published by Group Three Games in 1985
283             (no ISBN), see
284             L
285             abbreviated as I.
286              
287             =item *
288              
289             I
290             by Randy Cunningham with Jeff Ethell
291             published by Warner Books in 1984
292             ISBN 0-446-35458-9
293             abbreviated as I.
294              
295             =item *
296              
297             I
298             by Tom Clancy,
299             first published by Naval Institute Press in 1984
300             published by Fontana in 1987
301             ISBN 0-00-617276-8
302             abbreviated at I.
303              
304             =item *
305              
306             I
307             by Tom Clancy,
308             first published by G.P. Putnam's Sons in 1986,
309             published by Berkley International Edition in 1987
310             ISBN 0-425-10242-4
311             abbreviated as I.
312              
313             =item *
314              
315             I
316             by James W Bradin,
317             published by Avon Books in 1990,
318             ISBN 0-380-75847-4,
319             abbreviated as I.
320              
321             =item *
322              
323             I written by Dan McKinnon published by House of
324             Hits Publishing in 1987 and by Airlife Publishing Ltd in 1988,
325             abbreviated as I. For the ISBN, I am puzzled. On the
326             administrative page at the beginning of the book, there is a sticker
327             with number 1 85310 033 1 and on the flap of the book cover, the ISBN
328             is 1 85310 032 3. Take your pick.
329              
330             =item *
331              
332             I by Lon O. Nordeen, Jr., published by
333             the Smithsonian Institution in 1985 and by Air and Armour Press in
334             1985, ISBN 0-85368-751-X, abbreviated as I.
335              
336             =back
337              
338             =head1 SOVIET EQUIPMENT
339              
340             =cut
341              
342             __DATA__