Acme-MetaSyntactic-soviet

 view release on metacpan or  search on metacpan

lib/Acme/MetaSyntactic/soviet.pm  view on Meta::CPAN

# -*- encoding: utf-8; indent-tabs-mode: nil -*-
#
#     Acme::MetaSyntactic::soviet -- NATO codenames for Soviet-designed equipment
#     Copyright (C) 2008, 2012, 2016, 2021 Jean Forget
#
#     See the license in the embedded documentation below.
#
package Acme::MetaSyntactic::soviet;

use warnings;
use strict;

use Acme::MetaSyntactic::MultiList;
our @ISA = qw( Acme::MetaSyntactic::MultiList );
our $VERSION = '0.06';

my $data = { default => 'electronic' };
my ($category2, $category3);
my %seen;

_load_data_from_pod();

__PACKAGE__->init($data);

sub _load_data_from_pod {

  while (<DATA>) {
    if (/^=head2\s+(.*)/) {
      _flush_category();
      $category2 = lc($1);
      $category3 = '';
    }
    elsif (/^=head3\s+(.*)/) {
      _flush_category();
      $category3 = lc($1);
    }
    elsif (/=item\s+(.*?)\s*$/) {
      my $name = $1;
      $name =~ s/\s+/_/g;
      $name =~ s/_+/_/g;
      $seen{$name} = 1;
    }
    elsif (/^=head1/) {
      last;
    }
  }
  _flush_category();
}

sub _flush_category {
  if ($category2 and %seen) {
    $data->{names}{$category2}{$category3} = join ' ', sort keys %seen;
  }
  %seen = ();
}

38;
# Why 38? Hint: s/r$/t/

=encoding utf8

=head1 NAME

Acme::MetaSyntactic::soviet -- NATO codenames for Soviet-designed equipment

=head1 DESCRIPTION

Some codenames  given by  NATO to Soviet-designed  aircraft, missiles,
submarines,   radars  and  other   electronic  systems.   The  various
categories and sub-categories are

=over 4

=item *

electronic

=item *

electronic/radars

=item *

electronic/misc

=item *

vehicles

=item *

vehicles/aircraft

=item *

vehicles/helicopters

=item *

vehicles/missiles

=item *

vehicles/submarines

=item *

vehicles/error

=back

The default category is 'electronic'.

=head1 VERSION

This  is  version 0.06,  the  Fresco  version,  released on  the  49th
anniversary  of the  dogfight between  a  MiG-17 Fresco  flown by  ace
Colonel Tomb and a F-4 Phantom flown by soon-to-be-aces Cunningham and
Driscoll

=head1 SYNOPSIS

    use Acme::MetaSyntactic;

    my $meta = Acme::MetaSyntactic->new( 'soviet' );

    print $meta->name();          # return a single name
    my @names = $meta->name( 4 ); # return 4 distinct names (if possible)

If you want some category other than 'electronic', the second line should
read:

    my $meta = Acme::MetaSyntactic->new( 'soviet', category => 'vehicle/aircraft' );

If C<meta>  from L<Acme::MetaSyntactic> is  installed, you can  use it
from the command line:

    meta soviet

    meta soviet/vehicles/submarines

=head1 CONTRIBUTOR

Jean Forget

=head1 SOURCES

Note: I  have used only  sources published  I<before> the fall  of the
Soviet Union. Therefore, the module  name is C<A::MS::soviet>, with no
"ex-"  prefix. For  each  entry,  the sources  are  listed, with  page
numbers  for  most  books.  The   games  use  data  cards,  which  are
unnumbered.

Some sources, especially early  sources, may contain some errors. Some
equipment  may appear with  faulty intelligence  reports which  give a
wrong  code or  description.  And  a later  intelligence  report would
correct it.  The best  example is the  Backfire, first given  the code
"Tu-26" and then the code "Tu-22M".

=head2 Main Sources

These sources  contain extensive lists  or extensive tables  of soviet
equipment.

=over 4

=item *

I<Pat-Led-1>
written by J-J Patry and P. Lederer
published by Editions Presse & Recherche
abbreviated as I<PL>.



( run in 1.084 second using v1.01-cache-2.11-cpan-39bf76dae61 )