Skip to content

Instantly share code, notes, and snippets.

@miyagawa
Created November 29, 2012 02:19
Show Gist options
  • Save miyagawa/4166361 to your computer and use it in GitHub Desktop.
Save miyagawa/4166361 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
use strict;
my @code = qw( Alfa Bravo Charlie Delta Echo Foxtrot Golf Hotel India Juliett Kilo Lima
Mike November Oscar Papa Quebec Romeo Sierra Tango Uniform Victor Whiskey
X-ray Yankee Zulu );
my %code;
for my $word (@code) {
$code{substr($word, 0, 1)} = $word;
}
for my $char (split //, join '', @ARGV) {
print uc($char), " as ", $code{uc $char}, "\n";
}
__END__
> phonetic tatsuhiko
T as Tango
A as Alfa
T as Tango
S as Sierra
U as Uniform
H as Hotel
I as India
K as Kilo
O as Oscar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment