mailstats-alternate
上传用户:shbosideng
上传日期:2013-05-04
资源大小:1555k
文件大小:1k
- # use this method if you think it is better...
- # I did this one after I learnt a bit more perl!
- ##
- # munge the output data
- #
- while (<SOCK>) {
- $line = $_;
- ($a, $curfrm, $b, $curto, $c, $d) = split(' ',$line);
- }
- if ($a = "T") {
- # do some sums
- $msgsfrm = $curfrm - $oldfrm;
- $msgsto = $curto - $oldto;
- chomp $msgsfrm;
- chomp $msgsto;
- # open the old file for overwrite
- open (OLD,">/tmp/mailstat.old") or die "can't open file!n";
- # print the data for mrtg
- print "$msgsfrmn$msgston1n$remoten";
- # print the data to the old file
- print OLD "$curfrm $curton";
- } #endif
- close (SOCK) or die "close: $!";
- exit;