for my $shp ( @shapefiles ) { # Open the shapefile for processing my $shapefile = new Geo::ShapeFile($shp); # Point object for (x,y) address coordinate my $point = new Geo::ShapeFile::Point(X => $address->{'long'}, Y => $address->{'lat'}); if ( $shapefile->bounds_contains_point($point) ) { # Get data if the point falls inside this file for my $n ( 1..$shapefile->shapes() ) { my $shape = $shapefile->get_shp_record($n); if ( $shape->contains_point($point) ) { my %dbf = $shapefile->get_dbf_record($n); return \%dbf; } } } } # next shapefile