This is a module that simplifies translating US Military Paygrades (E-1, W-3, O-4) into the proper salutation for that rank, given the internet domain of the service of interest (af, army, navy, usmc, uscg). For generating mail in response to a form, it beats remembering. It has some historical notes as well.
package Paygrades; require Exporter; our @ISA = qw(Exporter); our @EXPORT = qw(paygrade); our @EXPORT_OK = qw(%navy %army %af %usmc); =historical notes Some of the paygrades listed below are no longer in use, the statutory authority for them having expired upon the death of GENA Bradley, others representing special conferrals on extraordinary commanders, and one established to ensure the seniority of George Washington to all United States military personnel, forever. Additionally, the United States Air Force no longer has Warrant Officers. The first officer promoted to Fleet Admiral was Leahy, who was President Roosevelt's Chief of Staff. He was joined by Ernest King (Chief of Naval Operations), Chester Nimitz (CinC, Pacific Ocean Areas) and William Halsey (COM7THFLT). The first officer promoted to General of the Army was George Marshall (Chief of Staff of the Army) joined by Douglas MacArthur (CinC, Southwest Pacific), Dwight Eisenhower (Supreme Commander, Allied Forces Europe) and Omar Bradley (US Army Europe). The only General of the Air Force to date was Harold 'Hap' Arnold, Chief of Staff, Army Air Forces. Admiral of the Navy was conferred on George Dewey for the victory at Manila Bay in the Spanish American War. General of the Armies was conferred on John 'Blackjack' Pershing for his command of the American Expeditionary Force during World War I. It is said that George Marshall was very apprehensive about being promoted to five stars, for fear of offending him. George Washington is sui generis, and the perpetual General of the Armies of the United States of America. =cut %navy = ( 'E-1' => 'Seaman', 'E-2' => 'Seaman', 'E-3' => 'Seaman', 'E-4' => 'Petty Officer', 'E-5' => 'Petty Officer', 'E-6' => 'Petty Officer', 'E-7' => 'Chief', 'E-8' => 'Senior Chief', 'E-9' => 'Master Chief', 'W-1' => 'Warrant Officer', 'W-2' => 'Chief Warrant Officer', 'W-3' => 'Chief Warrant Officer', 'W-4' => 'Chief Warrant Officer', 'W-5' => 'Chief Warrant Officer', 'O-1' => 'Ensign', 'O-2' => 'Lieutenant (j.g.)', 'O-3' => 'Lieutenant', 'O-4' => 'Lieutenant Commander', 'O-5' => 'Commander', 'O-6' => 'Captain', 'O-7' => 'Admiral', 'O-8' => 'Admiral', 'O-9' => 'Admiral', 'O-10' => 'Admiral', 'O-11' => 'Fleet Admiral', 'O-12' => 'Admiral of the Navy'); %usmc = ( 'E-1' => 'Private', 'E-2' => 'PFC', 'E-3' => 'Lance Corporal', 'E-4' => 'Corporal', 'E-5' => 'Sergeant', 'E-6' => 'Staff Sergeant', 'E-7' => 'Gunny', 'E-8' => 'Master Sergeant', 'E-9' => 'Master Guns', 'W-1' => 'Gunner', 'W-2' => 'Gunner', 'W-3' => 'Gunner', 'W-4' => 'Gunner', 'W-5' => 'Gunner', 'O-1' => 'Lieutenant', 'O-2' => 'Lieutenant', 'O-3' => 'Captain', 'O-4' => 'Major', 'O-5' => 'Lieutenant Colonel', 'O-6' => 'Colonel', 'O-7' => 'General', 'O-8' => 'General', 'O-9' => 'General', 'O-10' => 'General'); %army = ( 'E-1' => 'Private', 'E-2' => 'Private', 'E-3' => 'PFC', 'E-4' => 'Corporal', 'E-5' => 'Sergeant', 'E-6' => 'Staff Sergeant', 'E-7' => 'Sergeant', 'E-8' => 'Master Sergeant', 'E-9' => 'Sergeant Major', 'W-1' => 'Chief', 'W-2' => 'Chief', 'W-3' => 'Chief', 'W-4' => 'Chief', 'W-5' => 'Chief', 'O-1' => 'Lieutenant', 'O-2' => 'Lieutenant', 'O-3' => 'Captain', 'O-4' => 'Major', 'O-5' => 'Lieutenant Colonel', 'O-6' => 'Colonel', 'O-7' => 'General', 'O-8' => 'General', 'O-9' => 'General', 'O-10' => 'General', 'O-11' => 'General of the Army', 'O-12' => 'General of the Armies', 'O-13' => 'General of the Armies of the United States o +f America'); %usaf = ( 'E-1' => 'Airman', 'E-2' => 'Airman', 'E-3' => 'Senior Airman', 'E-4' => 'Sergeant', 'E-5' => 'Staff Sergeant', 'E-6' => 'Tech Sergeant', 'E-7' => 'Master Sergeant', 'E-8' => 'Senior Master Sergeant', 'E-9' => 'Chief Master Sergeant', 'W-1' => '', 'W-2' => '', 'W-3' => '', 'W-4' => '', 'W-5' => '', 'O-1' => 'Lieutenant', 'O-2' => 'Lieutenant', 'O-3' => 'Captain', 'O-4' => 'Major', 'O-5' => 'Lieutenant Colonel', 'O-6' => 'Colonel', 'O-7' => 'General', 'O-8' => 'General', 'O-9' => 'General', 'O-10' => 'General', 'O-11' => 'General of the Air Force'); sub paygrade { my ($title, $domain) = @_; my $paygrade; unless ($title =~ /(^W)|(^O)|(^E)/) { return $title; # print $title; } $domain = uc($domain); if ($domain =~ /NAVY/) { $paygrade = $navy{$title}; } elsif ($domain =~ /USCG/) { $paygrade = $navy{$title}; } elsif ($domain =~ /USMC/) { $paygrade = $usmc{$title}; } elsif ($domain =~ /AF\.MIL/) { $paygrade = $usaf{$title}; } elsif ($domain =~ /ARMY/) { $paygrade = $army{$title}; } else { $paygrade = "$army{$title}/$navy{$title}"; } #print $paygrade; return $paygrade; }

2006-06-02 Retitled by planetscape, as per Monastery guidelines

( keep:0 edit:10 reap:1 )

Original title: 'Paygrades'


In reply to Translate military paygrades to rank salutations by girarde

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.