#!/usr/bin/perl # ichijou0.pl - Don Yang (uguu.org) # # 06/19/06 use strict; my (@code); @code = qw{ echo tango alpha oscar india november hotel sierra romeo delta lima uniform mike charlie whiskey yankee foxtrot golf bravo papa victor kilo x-ray juliet zulu quebec }; @code = map { '($a, $b) = '. '($x =~ /^\s*([' . lc(substr $_, 0, 1) . uc(substr $_, 0, 1) . '])' . (substr $_, 1) . '\s*(.*?)$/s)' } @code; while(my $x = <>) { chomp $x; while($x ne '') { my $i; for($i = 0; $i <= $#code; $i++) { my ($a, $b); if( eval $code[$i] ) { print $a; $x = $b; last; } } if( $i > $#code ) { print substr $x, 0, 1; $x = substr $x, 1; } } print "\n"; }