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