Geo::TigerLine::Record::Parser - Parsing superclass for TIGER/Line records.
package Geo::TigerLine::Record::23; use base qw(Geo::TigerLine::Record::Parser); @records = __PACKAGE__->parse_file($fh); __PACKAGE__->parse_file($fh, \&callback); $record = __PACKAGE__->parse($row);
Parses raw TIGER/Line data into Geo::TigerLine::Record objects. This is intended to be used as a superclass of Geo::TigerLine::Record objects and not used directly.
You shouldn't be here.
@records = __PACKAGE__->parse_file($fh); __PACKAGE__->parse_file($fh, \&callback);
Parses a given filehandle as a TIGER/Line data file. The data definition is taken from __PACKAGE__->Pack_Tmpl, __PACKAGE__->Dict and __PACKAGE__->Fields. Returns an array of objects of type __PACKAGE__.
&callback will be called for each record and given a record object and its position in the file (ie. 1 for the first, 2 for the second, etc...). A sample callback...
sub callback { my($record, $pos) = @_; printf "Record #$pos is %s\n", $record->tlid; }
If a &callback is given, a list of records will NOT be returned. It is assumed you'll be taking care of arrangements to store the records in your callback and @records can eat up huge amounds of memory for a typical TIGER/Line data file.
$record = __PACKAGE__->parse($line);
Parses a single record of TIGER/Line data.
Michael G Schwern <schwern@pobox.com>
Geo::TigerLine
To install Geo::TigerLine, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Geo::TigerLine
CPAN shell
perl -MCPAN -e shell install Geo::TigerLine
For more information on module installation, please visit the detailed CPAN module installation guide.