#!/usr/bin/perl open(F, "staticdic") || die "cannot open file:$!\n"; open(DB, ">>staticdic1"); $tCache = "想定外文字"; $cCache = "そうていがい"; while(){ @txt = split(/\t/); chomp($txt[1]); if ($tCache ne $txt[0] or $cCache ne $txt[1]){ print DB "$txt[0]\t$txt[1]\n"; $tCache = $txt[0]; $cCache = $txt[1] } } close(DB); close(F);