Re: Need help using Gedcom.pm
[email protected] (Jutta Wrage) Fri, 5 May 2017 16:57:47 +0200
| Newsgroups | perl.gedcom |
|---|---|
| Message-ID | <[email protected]> |
Am 05.05.2017 um 13:47 schrieb Nigel Horne:
> 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> =
'married, but no husband relationship' });
> }
> $surname =3D $spouse->surname();
> $has_maiden_name =3D 1;
> }
> }
This does not work for me. Too many errors.
I have this code snippet included for testing purposes now:
my $surname;
if(my $husband =3D $i->husband()) {
$surname =3D $husband->get_value(["name", 1], "surn");
} else {
$surname =3D "";
}
I get a surname now for married people there. But if there are more than =
one partners it is always the very first one taken there, it seems, even =
if a loose partnership without marriage.
For example Anna Fehrs has three partners
1. Schadendorf - father of the first child only - no marriage
2. H=FCttmann - he died and left additional children to her - marriage
3. Thomsen - some more children - marriage
As "surname" I get Schadendorf, which never has been her name.
And even if I want to add a list of names there for all partners, I do =
not hnow how to get all ob them.
What bores me: she has a name, wen born, and she has another name to =
search for death records.
My list is used as a working table to see which records from church =
books and "Standesamt" I still need to get.
If I cannot get a list of all of her surnames (Name fields) from the =
gedcom export: Maybe I can get a list of her husbands using get_record =
or something like that?
If that matters: Gedcom file is VERS 5.5.1.
Regards,
Jutta
--=20
http://www.witch.westfalen.de