+#---------- prepare the database entry ----------
+
+my $du=$ENV{'YPPSC_DICTUPDATES'};
+chdir $du or die "$du $!"
+ if defined $du;
+
+
+my $fn_t= "_update.$$-xxxxxxxxxxxxxxxx.tmp";
+open F, "> $fn_t" or die "$fn_t $!";
+(stat F) or die $!;
+my $fn_i= sprintf "_update.$$-%016x.rdy", (stat _)[1];
+
+print F "ypp-sc-tools dictionary update v1\n";
+
+foreach my $v ($pirate,$dict,$ctx,$def,$image,$key,$val) {
+ printf F "%d\n", length($v) or die $!;
+ print F $v,"\n" or die $!;
+}
+
+close F or die $!;
+
+my @tm= localtime;
+my $tm= strftime "%Y-%m-%d %H:%M:%S %Z", @tm;
+
+open L, ">> _dict.log" or die $!;
+my $ll= sprintf "%s %-6s %-31s %s", $tm, $dict, $pirate, $fn_i;
+
+#---------- commit everything ----------
+
+print L "$ll submit\n" or die $!;
+L->flush or die $!;
+
+if (eval {
+
+ open S, "|sendmail -odb -oee -oi -t" or die $!;
+ print S $email or die $!;
+ $!=0; $?=0; close S or die $!; $? and die $?;
+
+ rename $fn_t, $fn_i or die "$fn_t $fn_i $!";
+
+ 1;
+}) {
+ print L "$ll stored\n" or die $!;
+} else {
+ print L "$ll ERROR! $@\n" or die $!;
+}
+close L or die $!;
+
+print header('text/plain'), "$fn_i\n" or die $!;