Geo::GeoNames::File - Perl module for handling GeoNames.org data files
use Geo::GeoNames::File;
my $file = Geo::GeoNames::File->open( qw/US.txt GB.txt/ );
while( my $rec = $file->next() ) { print $rec->name . "\n"; }
$file->close();
Provides a Perl extention for handling GeoNames.org data files. You may use this module to load GeoNames.org records from several seperate files.
Xiangrui Meng <mengxr@stanford.edu>
Copyright (C) 2009 by Xiangrui Meng
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
Open files.
my $file = Geo::GeoNames::File->open( @geonames_filenames );
Close open file handles.
my $record = $batch->next();
Return the next record in the file as a Geo::GeoNames::Record object. If a filter function is supplied, it will return the next filtered record.
sub pop_gt_100000 { return (shift->population > 100000); } my $record = $file->next( \&pop_gt_100000 );
To install Geo::GeoNames::Record, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Geo::GeoNames::Record
CPAN shell
perl -MCPAN -e shell install Geo::GeoNames::Record
For more information on module installation, please visit the detailed CPAN module installation guide.