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



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