The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Gedcom::Record - a class to manipulate Gedcom records

Version 1.05 - 20th July 1999

SYNOPSIS

  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"

DESCRIPTION

A selection of subroutines to handle records in a gedcom file.

Derived from Gedcom::Item.

HASH MEMBERS

Some of the more important hash members are:

$record->{new_xref}

Used by renumber().

$record->{recursed}

Used by renumber().

METHODS

parse

  $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.

collect_xrefs

  $record->collect_xrefs($callback)

Recursively collect all the xrefs. Called by Gedcom::collect_xrefs. $callback is not used yet.

resolve_xref

  my $xref = $self->resolve_xref($value)

See Gedcom::resolve_xrefs()

resolve

  my @famc = $self->resolve $self->child_values("FAMC")

For each argument, either return it or, if it an xref, return the referenced record.

resolve_xrefs

  $record->resolve_xrefs($callback)

See Gedcom::resolve_xrefs()

unresolve_xrefs

  $record->unresolve_xrefs($callback)

See Gedcom::unresolve_xrefs()

validate_semantics

  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.

normalise_dates

  $record->normalise_dates($format)

Change the format of all dates in the record.

See the documentation for Gedcom::normalise_dates

renumber

  $record->renumber($args)

Renumber the record.

See Gedcom::renumber().

child_value

  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().

child_values

  my @children = $record->child_values("CHIL")

Return a list of the values of the specified children. Calls get_children().

summary

  print $record->summary, "\n"

Return a line of text summarising the record.

Access functions

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.