Unix Man page/Perldoc/Info page, English-Chinese Dictionary,
Chinese-English Dictionary
Geo::TigerLine::RecordUserrContributed PerlGeo::TigerLine::Record::Parser(3pm) NAME Geo::TigerLine::Record::Parser - Parsing superclass for TIGER/Line records. SYNOPSIS 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); DESCRIPTION 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. Methods parse_file @records = __PACKAGE__->parse_file($fh); __PACKAGE__->parse_file($fh, \&callback); Parses a given filehandle as a TIGER/Line data file. The data def- inition is taken from __PACKAGE__->Pack_Tmpl, __PACKAGE__->Dict and __PACKAGE__->Fields. Returns an array of objects of type __PACK- AGE__. &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 sec- ond, 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. parse $record = __PACKAGE__->parse($line); Parses a single record of TIGER/Line data. AUTHOR Michael G Schwern <schwern AT pobox.com> SEE ALSO Geo::TigerLine perl v5.8.7 2004-05-1Geo::TigerLine::Record::Parser(3pm) |