Annotation of processmail/reminder.pl, revision 3.0

1.1       boris       1: #!/usr/local/bin/perl
                      2: #
3.0     ! boris       3: #$Id: reminder.pl,v 1.3 2005/02/15 19:27:51 boris Exp $
1.1       boris       4: #
                      5: # Читаем файл и шлем e-mail
                      6: #
                      7: #
                      8: # Исходные файлы и параметры
                      9: #
                     10: 
                     11:     use Getopt::Std; 
                     12: 
3.0     ! boris      13: $usage = 'reminder.pl $Revision: 1.3 $, $Date: 2005/02/15 19:27:51 $'. "\n".
1.3       boris      14: "Usage: reminder.pl [-d] [-r round]  [-o results] \n";
1.1       boris      15: 
                     16: require 'parameters.pl';
                     17: require 'subroutines.pl';
                     18: 
1.3       boris      19: die $usage unless getopts('r:o:d');
1.1       boris      20: 
                     21: $DEBUG=$opt_d;
                     22: 
                     23: my %teams;
                     24: 
                     25: #
                     26: # Читаем ответы команд
                     27: #
1.3       boris      28: $round=0;
                     29: if ($opt_r)
1.1       boris      30: {
1.3       boris      31:     $round=$opt_r;
3.0     ! boris      32:     foreach my $file ( @{$FILES[$opt_r]} ) {
1.3       boris      33:        open (INFILE, $file);
                     34:        readmail(\%teams);
                     35:        close (INFILE);
                     36:     }
1.1       boris      37: }
                     38: else
                     39: {
                     40:     *INFILE=*STDIN;
                     41: }
                     42: readmail(\%teams);
                     43: close(INFILE);
                     44: #
                     45: # Пишем мейл
                     46: #
                     47: if ($opt_o)
                     48: { 
                     49:     die "Cannot open $opt_o\n" unless open(OUTFILE,">$opt_o");
                     50: }
                     51: else
                     52: {
                     53:     open(OUTFILE,"|/usr/lib/sendmail -oi -t");
                     54: }
                     55: select OUTFILE;
                     56: &printheader;
                     57: foreach $team (keys %teams)
                     58: {
1.2       boris      59:     my $num=$teams{$team}->{'numletters'};
                     60:     print  "$team [$num]\n";
1.1       boris      61: }
                     62: 
                     63: &printfooter;
                     64: 

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