Created
September 25, 2010 22:44
-
-
Save lucapette/597375 to your computer and use it in GitHub Desktop.
a stupid perl script from my childhood
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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