#!/usr/bin/perl use DBI; use strict; use XML::Generator; my $dbh = DBI->connect( 'dbi:mysql:database=mapsbookex;host=db.maps.mcslp.com', 'mapsbookex', 'examples', ); print< Grantham features 1 EOF my $sth = $dbh->prepare(sprintf('select * from ch10 order by type')); $sth->execute(); my ($currenttype,$count) = ('',0); while (my $row = $sth->fetchrow_hashref()) { if ($currenttype ne $row->{type}) { if ($count > 0) { print ""; } printf("\n%s\n0\n",$row->{type}); $currenttype = $row->{type}; } $count++; printf("\n%s\n
%s,%s
\n\n%s,%s,0\n
\n", $row->{title}, $row->{adda}, $row->{addb}, $row->{lng}, $row->{lat}, ); } $sth->finish(); print("
\n
\n");