my $shapefile = Geo::ShapeFile->new ("tabblock2010_42_pophu"); my $totalblocks = $shapefile->shapes(); for (1 .. $totalblocks) { my %attr = $shapefile->get_dbf_record($_); my $blockid = $attr{BLOCKID10}; ...