--- processmail/reminder.pl 2002/02/04 17:22:28 1.1 +++ processmail/reminder.pl 2008/03/24 16:01:47 3.1 @@ -1,6 +1,6 @@ #!/usr/local/bin/perl # -#$Id: reminder.pl,v 1.1 2002/02/04 17:22:28 boris Exp $ +#$Id: reminder.pl,v 3.1 2008/03/24 16:01:47 boris Exp $ # # Читаем файл и шлем e-mail # @@ -10,13 +10,13 @@ use Getopt::Std; -$usage = 'reminder.pl $Revision: 1.1 $, $Date: 2002/02/04 17:22:28 $'. "\n". -"Usage: reminder.pl [-d] [-m mail_file] [-o results] \n"; +$usage = 'reminder.pl $Revision: 3.1 $, $Date: 2008/03/24 16:01:47 $'. "\n". +"Usage: reminder.pl [-d] [-r round] [-o results] \n"; require 'parameters.pl'; require 'subroutines.pl'; -die $usage unless getopts('t:m:o:d'); +die $usage unless getopts('r:o:d'); $DEBUG=$opt_d; @@ -25,9 +25,15 @@ my %teams; # # Читаем ответы команд # -if ($opt_m) +$round=0; +if ($opt_r) { - die "Cannot open $opt_m\n" unless open(INFILE,$opt_m) + $round=$opt_r; + foreach my $file ( @{$FILES[$opt_r]} ) { + open (INFILE, $file); + readmail(\%teams); + close (INFILE); + } } else { @@ -35,6 +41,7 @@ else } readmail(\%teams); close(INFILE); + # # Пишем мейл # @@ -50,8 +57,13 @@ select OUTFILE; &printheader; foreach $team (keys %teams) { - print "$team\n"; + my $num=$teams{$team}->{'numletters'}; + print "$team [$num]\n"; } &printfooter; +# +# На всякий случай проверяем на наличие команд с дублирующимися номерами. +# +check_dup_numbers(\%teams);