+die if $ocean =~ m/\=/;
+die if $island =~ m/\=/;
+
+$datafile= must_param('data',"^(deduped\\.tsv\\.gz)\$");
+$indatafh= upload('data'); fail("data is not a file") unless defined $datafh;
+
+our %done;
+
+my $content= MIME::Entity->build(Type => 'multipart/mixed',
+ Boundary => '=',
+ Charset => 'utf-8');
+
+my $clientspec= "$clientname $clientversion $clientfixes";
+foreach $vn (qw(ocean island
+ clientspec
+ clientname clientversion clientfixes)) {
+
+while (<$datafh>) {
+ !m/\P{IsPrint}/ or die bad_data('nonprinting char(s)');
+ my @v= split /\t/;
+ @v==6 or bad_data('wrong number of fields');
+ my ($commod,$stall) = @v;
+ defined $commods{$commod} or bad_data("unknown commodity \`$commod'");
+ $stall =~ m/^\p{IsUpper}/ or bad_data("stall not capitalised");
+ !exists $done{$commod,$stall} or bad_data("repeated data");
+ $done{$commod,$stall}= 1;
+ foreach my $f (@v[2..5]) {
+ $f =~ m/^(0|[1-9][0-9]{0,5}|\>1000)$/ or bad_data("bad field");
+ ($v % 1) or ($v !~ m/\>/) or bad_data("> in price");
+ }
+}
+
+
+
+