-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathdenato.pl
executable file
·58 lines (54 loc) · 1.06 KB
/
denato.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/perl -w
use strict;
my %table = (
A => "ALFA",
B => "BRAVO",
C => "CHARLIE",
D => "DELTA",
E => "ECHO",
F => "FOXTROT",
G => "GOLF",
H => "HOTEL",
I => "INDIA",
J => "JULIETT",
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 => "WHISKEY",
X => "XRAY",
Y => "YANKEE",
Z => "ZULU",
0 => "ZERO",
1 => "ONE",
2 => "TWO",
3 => "THREE",
4 => "FOUR",
5 => "FIVE",
6 => "SIX",
7 => "SEVEN",
8 => "EIGHT",
9 => "NINER"
);
my $commandline = @ARGV ? $ARGV[0] : '';
my @words = split /\s+/, $commandline;
foreach my $word (@words) {
keys %table; # reset each operator..
while ( my ( $key, $value ) = each %table ) {
if ( uc($word) eq $value ) {
print lc($key);
goto next_word;
}
}
print lc( substr( $word, 0, 1 ) ) . '?';
next_word:
}
print "\n";