% if ( $new{bill_error} or $new{ship_error} ) { Address standardization error % } % else { Confirm address standardization % }

% my @prefixes = (''); % if ( $old{same} ) { % @prefixes = ('bill_'); % } elsif ( $old{billship} ) { % @prefixes = ('bill_', 'ship_'); % } % for my $pre (@prefixes) { % my $name = $pre eq 'bill_' ? 'billing' : 'service'; % if ( $new{$pre.'error'} ) { % if ( $old{$pre.'company'} ) { % } % } else { # not an error % if ( !$new{$pre.'addr_clean'} ) { % } % if ( $old{$pre.'company'} ) { % } % } # if error % } # for $pre %# only do this part if address standardization provided a censustract % my $pre = $old{same} ? 'bill_' : 'ship_'; % my $censustract = $new{$pre.'censustract'}; % my $census_error = $new{$pre.'census_error'}; % if ( $censustract ) { % } #if censustract % if ( grep {$new{$_.'error'}} @prefixes ) { % } else {
Entered <%$name%> address
<% $old{$pre.'company'} %>
<% $old{$pre.'address1'} %> <% $new{$pre.'error'} %>
<% $old{$pre.'address2'} %>
<% $old{$pre.'city'} %>, <% $old{$pre.'state'} %> <% $old{$pre.'zip'} %>
Entered <%$name%> address Standardized <%$name%> address
(unverified)
<% $old{$pre.'company'} %> <% $new{$pre.'company'} %>
<% $old{$pre.'address1'} %> <% $new{$pre.'address1'} %>
<% $old{$pre.'address2'} %> <% $new{$pre.'address2'} %>
<% $old{$pre.'city'} %>, <% $old{$pre.'state'} %> <% $old{$pre.'zip'} %> <% $new{$pre.'city'} %>, <% $new{$pre.'state'} %> <% $new{$pre.'zip'} %>
Entered census tract Calculated census tract
<% $old{$pre.'censustract'} %> % if ( $census_error ) { <% $census_error %> % } else { <% $censustract %> % }
% } # !error <%init> # slightly weird interface... my $q = decode_json($cgi->param('q')); #warn Dumper($q); my %old = %{ $q->{old} }; my %new = %{ $q->{new} }; my $addresses = $old{billship} ? 'addresses' : 'address';