X-Git-Url: http://git.freeside.biz/gitweb/?p=Geo-Melissa-WebSmart.git;a=blobdiff_plain;f=WebSmart.pm;h=ddc89cf8b1b634884692554f7a0345b7a9fe8034;hp=c54ee1980c925111136b021016649360af4df9cf;hb=bd7d57b6aa7a1af31dc38384683a225c8e1ec02f;hpb=68c383d52b1f7316d820007e19e00ba7f62ba82f diff --git a/WebSmart.pm b/WebSmart.pm index c54ee19..ddc89cf 100644 --- a/WebSmart.pm +++ b/WebSmart.pm @@ -92,7 +92,7 @@ sub query { $root = $root->firstChild; # ResponseArray my $data = treeify($root); if (exists $data->{Record}) { - $self->address($data->{Address}); + $self->address($data->{Record}->{Address}); $self->code($data->{Record}->{Results}); } else { $self->code($data->{Results}); @@ -100,7 +100,7 @@ sub query { } else { $self->message( $resp->status_line ); } - if ( $geocode and $self->address and $self->address->{AddressKey} > 0 ) { + if ( $geocode and $self->address->{AddressKey} ) { $uri = URI->new($geocoder_uri); $uri->query_form( id => $opt{id}, @@ -199,11 +199,12 @@ error or warning messages. sub status_message { my $self = shift; - join("\n", - $self->message, + my $status = join("\n", map { $self->result_string($_) } split(',', $self->code) ); + $status = join("\n", $self->message, $status) if $self->message and $status; + $status; } =head2 result_string CODE