Changeset 684


Ignore:
Timestamp:
May 21, 2009, 8:43:23 AM (10 years ago)
Author:
sheldon
Message:

Improve error message when it can't process a postcode.

Also, it seems that the new version of the DBI module returns an arrayref rather
than a textual prepresentation of a mysql array, so we need to deref and join
rather than the mess of regexes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/npemap.org.uk/scripts/exporter/export.pl

    r674 r684  
    107107                $long = sprintf("%0.6f", $long);
    108108
    109                 # Make Source Nicer
    110                 $source =~ s/^\{//;
    111                 $source =~ s/\}$//;
    112                 $source =~ s/\"//g;
    113                 $source =~ s/,/;/g;
    114 
     109                # Convert source from array ref to CSV
     110                $source = join(",", @$source);
    115111                print "$outer,$inner,$e,$n,$lat,$long,$ngr,$grid,$source\n";
    116112        };
    117113        if ($@) {
    118            print STDERR "Error processing $outer $inner\n";
     114           print STDERR "Error processing $outer $inner\n -- $@";
    119115        };
    120116}
Note: See TracChangeset for help on using the changeset viewer.