#!/usr/bin/perl # ichijou1.pl - Don Yang (uguu.org) # # 06/19/06 if(@code = map { '($a, $b) = '. '($x =~ /^\s*([' . lc(substr $_, 0, 1) . uc(substr $_, 0, 1) . '])' . (substr $_, 1) . '\s*(.*?)$/s)' } 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 }) { while($x = <>) { chomp $x; while($x ne '') { for($i = 0; $i <= $#code; $i++) { if( eval $code[$i] ) { print $a; $x = $b; last; } } if( $i > $#code ) { print substr $x, 0, 1; $x = substr $x, 1; } } print "\n"; } }