File:  [Local Repository] / processmail / reminder.pl
Revision 1.3: download - view: text, annotated - select for diffs - revision graph
Tue Feb 15 19:27:51 2005 UTC (19 years, 4 months ago) by boris
CVS tags: Version_3
Started to move to the new scheme

    1: #!/usr/local/bin/perl
    2: #
    3: #$Id: reminder.pl,v 1.3 2005/02/15 19:27:51 boris Exp $
    4: #
    5: # Читаем файл и шлем e-mail
    6: #
    7: #
    8: # Исходные файлы и параметры
    9: #
   10: 
   11:     use Getopt::Std; 
   12: 
   13: $usage = 'reminder.pl $Revision: 1.3 $, $Date: 2005/02/15 19:27:51 $'. "\n".
   14: "Usage: reminder.pl [-d] [-r round]  [-o results] \n";
   15: 
   16: require 'parameters.pl';
   17: require 'subroutines.pl';
   18: 
   19: die $usage unless getopts('r:o:d');
   20: 
   21: $DEBUG=$opt_d;
   22: 
   23: my %teams;
   24: 
   25: #
   26: # Читаем ответы команд
   27: #
   28: $round=0;
   29: if ($opt_r)
   30: {
   31:     $round=$opt_r;
   32:     foreach my $file (split /\s+/, $FILES[$opt_r]) {
   33: 	open (INFILE, $file);
   34: 	readmail(\%teams);
   35: 	close (INFILE);
   36:     }
   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: {
   59:     my $num=$teams{$team}->{'numletters'};
   60:     print  "$team [$num]\n";
   61: }
   62: 
   63: &printfooter;
   64: 

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