Re: Need help using Gedcom.pm
[email protected] (Nigel Horne) Fri, 5 May 2017 07:47:14 -0400
| Newsgroups | perl.gedcom |
|---|---|
| Message-ID | <[email protected]> |
On 5/4/17 11:32 PM, Jutta Wrage wrote:
> Hi!
>
> I hope this it the right place to get some help using the module.
>
> I have written a little perl program to extract all persons from an exp=
orted Gedcom file to a tab delimited list. That works well so far.
>
> My problem now is how to get out the marriage names for persons who are=
marriaged.
> Is it possible to extract them from the gedcom file using gedcom.pm?
This snippet is from Gedcom::Individual::as_string in gedcal and=20
ged2site. I hope it helps to give you an idea on how to do it.
my $surname;
my $sex =3D get_value({ person =3D> $self, value =3D> 'sex' });
if(defined($sex) && ($sex eq 'F')) {
if(my $husband =3D $self->husband()) {
$surname =3D $husband->surname();
$has_maiden_name =3D 1;
} elsif(my $spouse =3D $self->spouse()) {
if($opts{'f'}) {
die 'married, but no husband relationship';
}
if($opts{'w'}) {
red_warning({ person =3D> $self, warning =3D> 'marri=
ed,=20
but no husband relationship' });
}
$surname =3D $spouse->surname();
$has_maiden_name =3D 1;
}
}
>
> Jutta
>
Regards,
-Nigel
--=20
Nigel Horne
Conductor: Rockville Brass Band, Washington Metropolitan GSO
@nigelhorne | fb/nigel.horne | bandsman.co.uk | concert-bands.co.uk | www=
=2Enigelhorne.com
Unless it's for my eyes only, please use "reply all"