ann.py: Various improvements.
[utils.git] / tel2name
index f9744bc..1623d7c 100755 (executable)
--- a/tel2name
+++ b/tel2name
@@ -90,21 +90,21 @@ if($wppid == 0) {
 binmode(YP, ":utf8");
 binmode(WP, ":utf8");
 
-match: while(<YP>) {
+match: while(<WP>) {
     chomp;
     for $prev (@matches) {
-       next match if $prev eq $_;
+       next match if (lc $prev) eq (lc $_);
     }
+    print "$_\n";
+    flush;
     push @matches, $_;
 }
-match: while(<WP>) {
+match: while(<YP>) {
     chomp;
     for $prev (@matches) {
-       next match if $prev eq $_;
+       next match if (lc $prev) eq (lc $_);
     }
+    print "$_\n";
+    flush;
     push @matches, $_;
 }
-
-for $match (@matches) {
-    print "$match\n";
-}