Skip to content

Instantly share code, notes, and snippets.

@lucapette
Created September 25, 2010 22:44
Show Gist options
  • Save lucapette/597375 to your computer and use it in GitHub Desktop.
Save lucapette/597375 to your computer and use it in GitHub Desktop.
a stupid perl script from my childhood
#!/usr/bin/perl -w
use strict;
my %letters=(
"A" => "ALFA",
"B" => "BRAVO",
"C" => "CHARLIE",
"D" => "DELTA",
"E" => "ECHO",
"F" => "FOXTROT",
"G" => "GOLF",
"H" => "HOTEL",
"I" => "INDIA",
"J" => "JULIET",
"K" => "KILO",
"L" => "LIMA",
"M" => "MIKE",
"N" => "NOVEMBER",
"O" => "OSCAR",
"P" => "PAPA",
"Q" => "QUEBEC",
"R" => "ROMEO",
"S" => "SIERRA",
"T" => "TANGO",
"U" => "UNIFORM",
"V" => "VICTOR",
"W" => "WHISKY",
"X" => "X-RAY",
"Y" => "YANKEE",
"Z" => "ZULU",
);
while (<>){
chomp;
my @l=grep {m/[A-Z]/} map {uc} split(//,$_);
print @letters{@l},"\n" if @l;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment