Annotation of parser3/src/lib/pcre/ruspart_win2koi.pl, revision 1.1

1.1     ! paf         1: sub code {
        !             2:        my($c)=@_;
        !             3:        $c=uc $c;
        !             4:        $c=~s/^0x/0x/i;
        !             5:        $c
        !             6: }
        !             7: 
        !             8: open WIN2KOI, 'win-koi.tab';
        !             9: while(<WIN2KOI>) {
        !            10:        chomp;
        !            11:        @from_to=split /\s/;
        !            12:        $win2koi{code($from_to[0])}=code($from_to[1]);
        !            13: }
        !            14: close WIN2KOI;
        !            15: 
        !            16: #char  white-space     digit   hex-digit       letter  word    lowercase       unicode1        unicode2        
        !            17: $header=<>;
        !            18: print $header;
        !            19: 
        !            20: while(<>) {
        !            21:        chomp;
        !            22:        @record=split "\t";
        !            23:        next unless $record[0]=$win2koi{code($record[0])};
        !            24:        if($record[6]) {
        !            25:                next unless $record[6]=$win2koi{code($record[6])};
        !            26:        }
        !            27:     print join("\t", @record), "\n";
        !            28: }

E-mail: