Gedcom::Record - a class to manipulate Gedcom records
Version 1.05 - 20th July 1999
use Gedcom::Record; $self->parse($record, $grammar) $record->collect_xrefs($callback) my $xref = $self->resolve_xref($self->{value}) my @famc = $self->resolve($self->child_values("FAMC")) $record->resolve_xrefs($callback) $record->unresolve_xrefs($callback) return 0 unless $child->validate_semantics $record->normalise_dates($format) $record->renumber($args) my $child = $record->child_value("NAME") my @children = $record->child_values("CHIL") print $record->summary, "\n"
A selection of subroutines to handle records in a gedcom file.
Derived from Gedcom::Item.
Some of the more important hash members are:
Used by renumber().
$self->parse($record, $grammar)
Parse a Gedcom record.
Match a Gedcom::Record against a Gedcom::Grammar. Warn of any mismatches, and associate the Gedcom::Grammar with the Gedcom::Record as $self->{grammar}. Do this recursively.
$record->collect_xrefs($callback)
Recursively collect all the xrefs. Called by Gedcom::collect_xrefs. $callback is not used yet.
my $xref = $self->resolve_xref($value)
See Gedcom::resolve_xrefs()
my @famc = $self->resolve $self->child_values("FAMC")
For each argument, either return it or, if it an xref, return the referenced record.
$record->resolve_xrefs($callback)
$record->unresolve_xrefs($callback)
See Gedcom::unresolve_xrefs()
return 0 unless $child->validate_semantics
Validate the semantics of the Gedcom::Record. This performs a number of consistency checks, but could do even more.
Returns true iff the Record is valid.
$record->normalise_dates($format)
Change the format of all dates in the record.
See the documentation for Gedcom::normalise_dates
$record->renumber($args)
Renumber the record.
See Gedcom::renumber().
my $child = $record->child_value("NAME")
Return the value of the specified child, or undef if the child could not be found. Calls get_child().
my @children = $record->child_values("CHIL")
Return a list of the values of the specified children. Calls get_children().
print $record->summary, "\n"
Return a line of text summarising the record.
All the Gedcom tag names can be used as function names. Depending on the context in which they are called, the functions return either an array of the specified children, or the first specified child.
The descriptions of the tags, with spaces replaced by underscores, can also be used as function names. The function names can be of either, or mixed case. Unless you use the tag name, in either case, or the description in lower case, the function will not be pre-declared and you will need to qualify it or use subs.
use subs
To install Gedcom, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Gedcom
CPAN shell
perl -MCPAN -e shell install Gedcom
For more information on module installation, please visit the detailed CPAN module installation guide.