2 package ModerationCommon;
6 our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
11 @EXPORT = qw(hash $hashlen
13 sendmail_start sendmail_finish);
14 %EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ],
22 my $r= `echo $_[0] | sha256sum`; $? and die $?;
28 sub sendmail_start () {
29 open ::P, "|/usr/sbin/sendmail -odb -oee -oi -t" or die $!;
31 sub sendmail_finish () {
32 $?=0; $!=0; close ::P or warn "$! $?";
37 sub readsettingsfile ($) {
39 open SET, "<$file" or die "$file $!";
43 m/^([A-Z_]+)\=(.*?)\s*$/ or die;
49 readsettingsfile("../../global-settings");
50 readsettingsfile("../settings");