Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: MVC Catalyst Architecture - City, State Zip locator

by dotcomguy (Initiate)
on Jul 21, 2008 at 16:15 UTC ( [id://699069] : note . print w/replies, xml ) Need Help??


in reply to MVC Catalyst Architecture - City, State Zip locator

This is code that I originally developed for WeilMclain. If the problem is city/state searches then you need to look at get_zip() because it has to search the zips table to find a zip code for the given city and state. If that doesn't find a zip code for a given city/state it won't work. I also have the original file as well if you need it. Feel free to contact me at dennyd@triple-d.us for more assistance

Replies are listed 'Best First'.
Re^2: MVC Catalyst Architecture - City, State Zip locator
by Anonymous Monk on Jul 21, 2008 at 19:10 UTC
    Thats what I was understanding when looking at the code. To me and a few people who have looked at it - its fine and should be working. Thats why were stumped. It seems there is something fouling it up that isn't obviously apparent. Perhaps something outside the WeilMclain and WeilMclainDB folders. Thank you much for your help with this. I emailed you a bit ago.
      Problem solved! Here is what changed in the zips.pm
      sub get_zip { my ($self, $city, $state) = @_; $cityy= s/\b(\w)(\w*)/uc($1).lc($2)/ge for $city; #print "$city"; # return undef unless ($city && $state =~ /^(\d*)$/); if (my $zip = $self->single({city_name => $city,state_abbr=>uc($st +ate)},{columns => [qw/zip_code/]})) { return $zip->get_column('zip_code'); } return undef; return $self->single({city_name=>$city,state_abbr=>uc($state)},{co +lumns=>[qw/zip_code/]})->get_column('zip_code'); }
      Thank you all for your help!