Annotation of db/prgsrc/dumpRS.pl, revision 1.2

1.2     ! boris       1: #!/usr/bin/perl -w
        !             2: 
        !             3: =head1 NAME
        !             4: 
        !             5: dumpRS.pl - скрипт для создания дампа таблицы word2question.
        !             6: 
        !             7: =head1 SYNOPSIS
        !             8: 
        !             9: dumpRS.pl output
        !            10: 
        !            11: =head1 DESCRIPTION
        !            12: 
        !            13: Создаёт дамп таблицы  word2question. Формат записи:
        !            14: идентификатор слова (2 байта), длина поля questions (4 байта), 
        !            15: содержимое поля questions.
        !            16: 
        !            17: =head1 AUTHOR
        !            18: 
        !            19: Роман Семизаров
        !            20: 
        !            21: 
        !            22: =cut
        !            23: 
        !            24: 
        !            25: use dbchgk;
        !            26: 
        !            27: 
        !            28: my $output=shift;
        !            29: 
        !            30: if (!$output) 
        !            31: { 
        !            32:   print "Usage: dumpRS.pl output\n";
        !            33:   exit
        !            34: }
        !            35: 
        !            36: open OUT, ">$output" or die "Can not open $output";
        !            37: binmode(OUT);
        !            38: open STDERR, ">errors";
        !            39: getword2question;
        !            40: 
        !            41: while (($word,$quest)=getrow,$word)
        !            42: {  
        !            43:    print "$sch...\n" unless (++$sch%100);
        !            44:    print OUT pack("L",$word);
        !            45:    print OUT pack("L", length $quest);
        !            46:    print OUT $quest;
        !            47: }
        !            48: 
        !            49: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>