File:  [Local Repository] / processmail / reminder.pl
Revision 1.2: download - view: text, annotated - select for diffs - revision graph
Mon Feb 4 17:32:41 2002 UTC (22 years, 5 months ago) by boris
Added number of letters

#!/usr/local/bin/perl
#
#$Id: reminder.pl,v 1.2 2002/02/04 17:32:41 boris Exp $
#
# Читаем файл и шлем e-mail
#
#
# Исходные файлы и параметры
#

    use Getopt::Std; 

$usage = 'reminder.pl $Revision: 1.2 $, $Date: 2002/02/04 17:32:41 $'. "\n".
"Usage: reminder.pl [-d] [-m mail_file]  [-o results] \n";

require 'parameters.pl';
require 'subroutines.pl';

die $usage unless getopts('t:m:o:d');

$DEBUG=$opt_d;

my %teams;

#
# Читаем ответы команд
#
if ($opt_m)
{
    die "Cannot open $opt_m\n" unless open(INFILE,$opt_m)
}
else
{
    *INFILE=*STDIN;
}
readmail(\%teams);
close(INFILE);
#
# Пишем мейл
#
if ($opt_o)
{ 
    die "Cannot open $opt_o\n" unless open(OUTFILE,">$opt_o");
}
else
{
    open(OUTFILE,"|/usr/lib/sendmail -oi -t");
}
select OUTFILE;
&printheader;
foreach $team (keys %teams)
{
    my $num=$teams{$team}->{'numletters'};
    print  "$team [$num]\n";
}

&printfooter;


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