+die "usage: $0 <configfile>\n" unless scalar @ARGV;
+
+my $config;
+
+my $cfgfname = $ARGV[0];
+open my $cfgfile, "<", $cfgfname
+ or die "config file $cfgfname not found: $!\n";
+while (<$cfgfile>){
+ chomp;
+ s/#.*//;
+ next if m/^$/;
+ my ($key, $val) = split ": ", $_, 2;
+ warn "$0: warning: redefining config key $key\n" if defined $config->{$key};
+ $config->{$key} = $val;
+}
+close $cfgfile;
+
+for ( qw/input items title link description subject creator publisher rights language/ ) {
+ die "config option '$_' missing in $cfgfname\n" unless $config->{$_};
+}
+open REMOVALS, "<", $config->{input};