Skip to content

Instantly share code, notes, and snippets.

@lucapette lucapette/alfa.pl
Created Sep 25, 2010

Embed
What would you like to do?
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
You can’t perform that action at this time.